HTTP TLS background error "key "Socket" not known in dictionary"
Brought to you by:
apnadkarni
Dear Ashok,
I am sorry to bother you with an issue showing-up on a client PC.
The code is as follows:
package require http
package require iocp_inet
rename ::socket ::socket_ori
rename ::iocp::inet::socket ::socket
package require autoproxy
::autoproxy::configure -host ""
::autoproxy::init
package require twapi_crypto
http::register https 443 [concat {::twapi::tls_socket} -verifier TWAPIVerifier]
proc TWAPIVerifier {args} {
return 1
}
http::geturl $URLQuery\
-headers $lHeader\
-type "application/json;charset=utf-8"\
-timeout 2000\
-keepalive 1\
-query {{
"timestamp": "2022-06-13T06:41:55Z",
...
}
}}
The http package log is as follows:
^A1 URL https://psemain.zeiss.org:44310/sapmeext-czsmt-ws/sapmeext-czsmt-rs/JSONInboundSyncService/receiveEquipmentStatusChange - token ::http::1
{Using rc984 for psemain.zeiss.org:44310 - token ::http::1} {}
Then, there is a background error origin from TWAPI:
> key "Socket" not known in dictionary
> while executing
> "dict get $_channels($chan) Socket"
> (procedure "_chansocket" line 7)
> invoked from within
> "_chansocket $chan"
> (procedure "cget" line 15)
> invoked from within
> "::twapi::tls cget rc984 -error"
> (chan handler subcommand "cget")
> invoked from within
> "fconfigure $state(sock) -error"
> (procedure "http::Connect" line 8)
> invoked from within
> "http::Connect ::http::1 https {} /sapmeext-czsmt-ws/sapmeext-czsmt-rs/JSONInboundSyncService/receiveEquipmentStatusChange"
And the stack trace:
> INNER:dictGet
> CALL:_chansocket rc984
> CALL:cget rc984 -error
> CALL:http::Connect ::http::1 https {} /sapmeext-czsmt-ws/sapmeext-czsmt-rs/JSONInboundSyncService/receiveEquipmentStatusChange
> CALL:http::Connect ::http::1 https {} /sapmeext-czsmt-ws/sapmeext-czsmt-rs/JSONInboundSyncService/receiveEquipmentStatusChange
> CALL:::twapi::tls::_post_write_event_callback rc984
I suppose, ther error is thrown before the connection is established.
Package versions:
I am sorry for the bug report for 4.7a0.
In TWAPI 4.7.1, the routine _chansocket guards against that error:
proc twapi::tls::_chansocket {chan} {
debuglog [info level 0]
variable _channels
if {![info exists _channels($chan)]} {
error "Channel $chan not found."
}
return [dict get $_channels($chan) Socket]
}
But even, with this protection, it would error out, just with the error message "Channel not found".
I fear, we have an early abort of the TLS negociation.
Thank you and take care,
Harald
Anonymous
Thank you for the 4.7.1 starkits. This was delivered the day to the client.
I will report here, if the issue arises again.
Thank you so much,
Harald
THank you. I suppose, this is fixed with bug #206.
Ticket may be closed.
Thank you,
Harald