Posted to tcl by jima at Thu Nov 19 13:42:48 GMT 2015view raw

  1. package require http
  2. package require -exact tls 1.6
  3. proc JIMA_TLS {args} {
  4. puts JIMA_TLS($args)
  5. }
  6.  
  7.  
  8. proc client {host port} {
  9. set s [
  10. ::tls::socket -require 0 -request 0 -ssl3 0 -ssl2 0 -tls1 1 -tls1.1 1 -tls1.2 1 -command JIMA_TLS $host $port
  11. ]
  12. fconfigure $s -blocking 0
  13. return $s
  14. }
  15.  
  16. set s [client localhost 8080]
  17. puts $s "Hello!"
  18. gets $s line
  19. puts $line
  20.