Posted to tcl by apn at Tue Aug 16 08:18:21 GMT 2022view raw

  1. proc verify {remote_name chan ctx} {
  2. set remote_cert [twapi::sspi_remote_cert $ctx]
  3. try {
  4. if {$remote_name eq ""} {
  5. set status [twapi::cert_tls_verify $remote_cert -revocationcheck none -ignoreerrors time]
  6. } else {
  7. set status [twapi::cert_tls_verify $remote_cert -revocationcheck none -ignoreerrors time -server $remote_name]
  8. }
  9. return [string equal $status ok]
  10. } finally {
  11. twapi::cert_release $remote_cert
  12. }
  13. }
  14.  
  15. set so [twapi::tls_socket -verifier [list verify otgw.tclcode.com] otgw.tclcode.com 443]
  16.