TLS module
This module provides TLS network encryption. The functions in this module are called by the Net module and cannot usefully be used directly.
TLS encryption is only useful if the identity of the server connected to can be verified. The various networking functions in the Net and HTTP modules allow a list of certificate files to be specified. On POSIX systems, Certification Authority certificates are often stored in the /etc/ssl/certs directory, and if the signer of the server certificate is not known in advance, you may wish to specify many or all of the .pem files in this directory that correspond to CAs that you trust.
Data types
- TLS::TLSsession - A TLS connection session
Exceptions
- AcceptCertificateFailed - TLS certificate acceptance failed
- TLSFailed - TLS handshake failed
- TLSTimeout - TLS timeout
- VerifyFailed - TLS peer verification failed
Functions
- Void acceptCertificate(TLSsession session,String certfile) - Accept certificates.
- Void closeTLS(TLSsession tls) - Close TLS connection
- String getTLS(TLSsession tls,Bool iiscompensation=false,Int maxlen=-1,Int timeout=0,Bool(Int) checktimeout) - Receive encrypted data
- Int getTLSByte(TLSsession tls,Bool iiscompensation=false) - Receive encrypted byte
- Binary getTLSBytes(TLSsession tls,Bool iiscompensation=false) - Receive encrypted binary data
- TLSsession makeTLS(Ptr conn) - Initialise a TLS connection
- Void putTLS(TLSsession tls,String toput) - Send encrypted data
- Void putTLSByte(TLSsession tls,Int toput) - Send a single encrypted byte
- Void putTLSBytes(TLSsession tls,Binary toput) - Send encrypted binary data
- Void verifyCertificate(TLSsession session,String hostname="") - Verify a server's certificate