Using
package require http
package require tls
http::register https 443 [list ::tls::socket -autoservername true]
set token [http::geturl https://my.secure.site/]
Mark schrieb am Sonntag, 28. November 2021 um 15:31:45 UTC+1:
Usingand with e.g.:
package require http
package require tls
http::register https 443 [list ::tls::socket -autoservername true]
set token [http::geturl https://my.secure.site/]
set token [::http::geturl https://www.google.com/]
best regards
Gregor
# Tcl/Tk 8.6.12, tls 1.7.22, Linux)
info patchlevel
package present tls
Mark Tarver <[email protected]> schrieb:
On Sunday, 28 November 2021 at 15:55:48 UTC, greg wrote:...
Mark schrieb am Sonntag, 28. November 2021 um 15:31:45 UTC+1:
Usingand with e.g.:
package require http
package require tls
http::register https 443 [list ::tls::socket -autoservername true]
set token [http::geturl https://my.secure.site/]
set token [::http::geturl https://www.google.com/]
sadly
wrong # args: should be "tls::socket ?options? host port"
still comes back - its not the URL I think.
MarkWell, not knowing much about tls I see that Tcl is tellling you, what
it expects:
- tls::socket -- this you supply
- ?options? -- your '-autoservername true'
- host port -- these are missing, therefore it complains 'wrong number
of args'.
Try supplying them and see what happens.
HTH
Helmut
On Sunday, 28 November 2021 at 15:55:48 UTC, greg wrote:...
Mark schrieb am Sonntag, 28. November 2021 um 15:31:45 UTC+1:
Usingand with e.g.:
package require http
package require tls
http::register https 443 [list ::tls::socket -autoservername true]
set token [http::geturl https://my.secure.site/]
set token [::http::geturl https://www.google.com/]
sadlyWell, not knowing much about tls I see that Tcl is tellling you, what
wrong # args: should be "tls::socket ?options? host port"
still comes back - its not the URL I think.
Mark
Well after experimentation I found this worked
package require http
package require tls
::http::register https 443 [list ::tls::socket -request 1 -ssl2 0 -ssl3 0 -tls1 1 -cafile VeriSignClass3SecureServerCA-G3.crt]
set token [::http::geturl https://www.google.com/]
upvar #0 $token state
puts $state(body)
On 11/28/21 1:39 PM, Mark Tarver wrote:
Well after experimentation I found this worked
package require http
package require tls
::http::register https 443 [list ::tls::socket -request 1 -ssl2 0
-ssl3 0 -tls1 1 -cafile VeriSignClass3SecureServerCA-G3.crt]
set token [::http::geturl https://www.google.com/]
upvar #0 $token state
puts $state(body)
I don't think you need any certificates for client type work. The
original version of your code works fine - albeit with one small change:
take out the "-autoservername true". I am not sure what the option is intended to do but I faintly recall to also have had issues with it in
the past with the http/tls combination.
package require http
package require tls
http::register https 443 [list ::tls::socket]
set token [::http::geturl https://www.google.com/]
upvar #0 $token state
puts [string length $state(body)]
prints out 50615 as the size of the page.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 07:45:21 |
| Calls: | 12,100 |
| Files: | 15,003 |
| Messages: | 6,517,937 |