Class SSLContext

Encapsulates the configuration for an SSL tunnel.

Note that when creating an SSLContext with SSLContextKind.client, the peerValidationMode will be set to SSLPeerValidationMode.trustedCert, but no trusted certificate authorities are added by default. Use useTrustedCertificateFile to add those.

Inherits from

  • Object (base class)

Constructors

Name Description
this Creates a new context of the given kind.
this Convenience constructor to create a server context - will be deprecated soon
this Convenience constructor to create a client context - will be deprecated soon

Properties

Name Type Description
kind [get] SSLContextKind The kind of SSL context (client/server)
maxCertChainLength [get, set] int The maximum length of an accepted certificate chain.
peerValidationCallback [get, set] bool delegate(scope SSLPeerValidationData) An optional user callback for peer validation.
peerValidationMode [get, set] SSLPeerValidationMode Specifies the validation level of remote peers.

Methods

Name Description
useCertificateChainFile Sets a certificate file to use for authenticating to the remote peer
usePrivateKeyFile Sets the private key to use for authenticating to the remote peer based on the configured certificate chain file.
useTrustedCertificateFile Sets the list of trusted certificates for verifying peer certificates.

Authors

Sönke Ludwig

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.