JadeSSLContext Class

The JadeSSLContext class implements the behavior required for secure connections using a Secure Sockets Layer (SSL) library protocol instead of the Transmission Control Protocol / Internet Protocol (TCP/IP) protocol when the TcpIpConnection class sslContext property contains a reference to a JadeSSLContext transient object.

SSL is a secure communication protocol on top of an already established TCP/IP connection. SSL libraries are generated from publicly available third-party sources, maintained by the OpenSSL Group (http://www.openssl.org). JADE supports TLS (Transport Layer Security) version 1, TLS version 1.1, and TLS version 1.2.

JadeSSLContext connections use digital certificates in X509 format, which must exist on disk in Privacy‑Enhanced Electronic Mail (PEM)‑encoded certificate (PEM) format.

The method in the following example opens an outgoing SSL connection.

vars
    tcpip      : TcpIpConnection;
    sslContext : JadeSSLContext;
    x509       : JadeX509Certificate;
begin
    create x509 transient;
    x509.readCertificateDataFromFile("c:\Certificates\client.pem");
    x509.readPrivateKeyDataFromFile("c:\Certificates\client.key", "myPassword");
    create sslContext transient;
    sslContext.methodType := JadeSSLContext.MethodTLSv1_2;
    sslContext.caFile := "c:\Certificates\serverCAcerts.pem";
    sslContext.x509 := x509;
    create tcpip transient;
    tcpip.name := "mySSLNode";
    tcpip.port := 8097;
    tcpip.sslContext := sslContext;
    tcpip.open;
    // ... send and receive some data
    tcpip.close;
epilog
    delete x509;
    delete sslContext;
    delete tcpip;
end;

The method in the following example listens for an incoming SSL connection request.

vars
    tcpip : TcpIpConnection;
    sslContext : JadeSSLContext;
    x509: JadeX509Certificate;
begin
    create x509 transient;
    x509.readCertificateDataFromFile("c:\Certificates\server.pem");
    x509.readPrivateKeyDataFromFile("c:\Certificates\server.key", "mySrvPassword");
    create sslContext transient;
    sslContext.methodType := JadeSSLContext.MethodTLSv1_2;
    sslContext.caFile := "c:\Certificates\clientCAcerts.pem";
    sslContext.x509 := x509;
    create tcpip transient;
    tcpip.port := 8097;
    tcpip.sslContext := sslContext;
    tcpip.listen;
    // ... send and receive some data
    tcpip.close;
epilog
    delete x509;
    delete sslContext;
    delete tcpip;
end;

For details about the constants, properties and methods defined in the JadeSSLContext class, see "JadeSSLContext Class Constants", "JadeSSLContext Properties" and "JadeSSLContext Methods", in the following subsections. For details about returning the type of encryption being used by a JADE thin client TCP/IP connection in the current application, see the Application class getThinClientEncryptionType method.

Object

(None)