Am 18.04.2018 um 09:05 schrieb Harald Oehlmann:
> Am 17.04.2018 um 16:19 schrieb Ashok:
>> Tested with one proxy server from one client system :-)
Ashok,
I have a very strange issue for the non-proxy case.
So:
package require autoproxy
::autoproxy::init
package require twapi_crypto
autoproxy::configure -tls_package twapi
http::register https 443 ::autoproxy::tls_socket
% parray autoproxy::options
autoproxy::options(authProc) =
autoproxy::options(basic) =
autoproxy::options(no_proxy) =
autoproxy::options(proxy_host) =
autoproxy::options(proxy_port) = 80
autoproxy::options(tls_package) = twapi
This should be identical to
http::register https 443 ::twapi::tls_socket
But I get an error in the geturl call in the first case.
And I dont find out what is happenning...
The command is:
http::geturl
{
https://accessgudid.nlm.nih.gov/api/v1/devices/lookup.xml?di=J019ABC1234}
In the first case, I get the error dict:
-code 1
-level 0
-errorstack {
INNER {invokeStk1 http::geturl
https://accessgudid.nlm.nih.gov/api/v1/devices/lookup.xml?di=J019ABC1234}
CALL {HTTPGet
https://accessgudid.nlm.nih.gov/api/v1/devices/lookup.xml?di=J019ABC1234}}
-errorcode NONE
-errorinfo {Invalid SSPI security context handle
while executing
"http::geturl $URL"}
-errorline 2
In the second case, all works o.k. (correct status 404 is returned which
is ok).
I tried to find out what is happenning.
So, I have put a puts in:
proc ::autoproxy::tls_connect {args} {
...
if {$options(tls_package) eq "twapi"} {
puts >>>[linsert $args 0 ::twapi::tls_socket]<<<
set s [eval [linsert $args 0 ::twapi::tls_socket]]
It returns:
>>>::twapi::tls_socket -async
accessgudid.nlm.nih.gov 443<<<
Many tries led to the fact, that the new code in autoproxy::tls_socket
is the issue.
If I add a "return $s" just after the call of tls_connect, the error is
gone.
E.g.:
proc ::autoproxy::tls_socket {args} {
variable options
# Look into the http package for the actual target. If a proxy is in
use then
# The function appends the proxy host and port and not the target.
upvar host uhost port uport
set args [lrange $args 0 end-2]
lappend args $uhost $uport
set s [eval [linsert $args 0 tls_connect]]
return $s
}
I think, this part is anyway only to get some info into the state array...
Without that, anything works for me....
Thank you,
Harald