Methods for working with SSL certificates and encrypted data.
When using SSL, you need to provide a server-side certificate, a private key, and often a password as part of the context. The INET::SSLSocket method automatically creates the context object, which can be accessed by referencing the Context property. Alternatively, you can create a context object and assign it to each new INET::SSLSocket. Since initializing the context is fairly expensive to establish, you can get better performance by sharing the context among sockets.
This example does not use the INET::SSLContext object.
dim Socket as INET::SSLSocket Socket.Context.CertificateFile = CertificatePath + "secure.alphafiveonline.com.crt" Socket.Context.PrivateKeyFile = CertificatePath + "secure.alphafiveonline.com.key" Socket.Context.password = ""
This example uses the INET::SSLContext object.
dim Context as SQLContext dim Socket as INET::SSLSocket Context.CertificateFile = CertificatePath + "secure.alphafiveonline.com.crt" Context.PrivateKeyFile = CertificatePath + "secure.alphafiveonline.com.key" Context.password = "" if .not. Context.EstablishContext() ' Check Context.callresult and write code to handle error end if Socket.Context = Context
The path and name of the private key file.
The path and name of the SSL Server Certificate file.
The path and name of the SSL Certificate Authority file.
The path and name of the SSL Certificate Chain file.
String Password property
Information about success or failure.
String CipherList property
ServerName is used to force a value for Server Name Indication (SNI) when that value is different than the host name passed to the INET::SSLSocket.Connect() function. This property is not typically used and is optional. For example, you may want to connect to a specific server that is behind a load balancer and the server instance terminates TLS (SSL). In that case, you would set the ServerName property of the INET::SSLContext object to match the server name expected on the certificate and then pass the IP address of the server to INET::SSLSocket.Connect() as the host.
- CreateCertificateRequest Method
Create a request for a certificate.
- CreatePrivateKey Method
Create a private key with an optional password and write to KeyFileName. Bits must be one of 512, 1024, 2048, or 4096
- CreateTestCertificate Method
Create a server test certificate using an existing private key.
- DecryptString Method
Decrypts a string which has been encrypted and converted to base64 encoding.
- EncryptString Method
Encrypts the string provided and encodes the encryption result using base64 encoding.
- EstablishContext Method
Create and verify SSL parameters and settings. This function is optional. Use it if you want to verify a context.