OScript API/Built-in Package Index

Class: SSLOptions

The built-in functions in the SSLOptions Package allow the SMTPSession and POP3Session to communicate using SSL sockets and configure the SSL options as required.

The SSLOptions Package offers the following functionality:

Instance Attributes

Don't bother to do any cert verification

Do a relaxed cert verification. This is the default

X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH

X509_V_ERR_AKID_SKID_MISMATCH

X509_V_ERR_CERT_HAS_EXPIRED

X509_V_ERR_CERT_NOT_YET_VALID

X509_V_ERR_CERT_REJECTED

X509_V_ERR_CERT_SIGNATURE_FAILURE

X509_V_ERR_CERT_UNTRUSTED

X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT

X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD

X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD

X509_V_ERR_INVALID_CA

X509_V_ERR_INVALID_PURPOSE

X509_V_ERR_KEYUSAGE_NO_CERTSIGN

X509_V_ERR_PATH_LENGTH_EXCEEDED

X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN

X509_V_ERR_SUBJECT_ISSUER_MISMATCH

X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY

X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE

X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT

X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY

X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE

Class Methods

New( )

Returns a new SSLOptions class, or undefined if an error occured.

Instance Methods

Returns the path to the certificate file.

Returns the current cipher list string.

Clears the ignored error list.

Returns a list of the errors added via [IgnoreError].

Returns a string containing the text of the last error, if any.

IgnoreError( Integer errorConstant )

Tells the SSL socket negotiation to ignore the specified certificate validation error.

Returns the path to the private key file.

Returns the private key passphrase.

Returns the path to the root certificates.

SetCertificateFileLocation( String filepath )

Sets the path to the certificate file.

SetCipherList( String cipherList )

Sets the SSL verification cipher list.

SetPrivateKeyFileLocation( String filepath )

Sets the path to the private key file.

SetPrivateKeyPassphrase( String passPhrase )

Sets the private key file passphrase that was used to encrypt the private key file.

SetRootCertificatesLocation( String filepath )

Sets the path to the root certificates.

SetVerificationDepth( Integer depth )

Sets the SSL certificate verification depth.

SetVerificationFlag( Integer flag )

Sets the SSL certificate verification flag.

Returns the verification depth.

Returns the current verification flag value.

Instance Attributes

Class Methods

New

SSLOptions New()

Returns a new SSLOptions object

Returns:

A new SSLOptions object or undefined if there was an error constructing the object.

Instance Methods

CertificateFileLocation

String CertificateFileLocation()

No parameters. Returns the certificate file location string.

Returns:

Returns the certificate file location string.

CipherList

String CipherList()

No parameters. Returns the current cipher list string.

Returns:

Returns the current cipher list string.

ClearErrorList

Integer ClearErrorList()

No parameters. Removes all errors entered by the IgnoreError() function.

Returns:

Returns 0 for success and -1 if an error occurred.

GetIgnoredErrorList

List GetIgnoredErrorList()

No parameters. Returns a List of Integers of the errors added via IgnoreError().

Returns:

Returns a List of Integers of the errors added via IgnoreError().

GetLastError

String GetLastError()

No parameters. Returns an error string for the last error that occured.

Returns:

Returns an error string for the last error that occured.

IgnoreError

Integer IgnoreError( Integer errorConstant )

Sets certificate verification errors to be ignored when doing an SSL negotiation.

Parameters

errorConstant

Any of the SSL Error Constants above.

Returns:

Returns 0 for success and -1 if an error occurred.

PrivateKeyFileLocation

String PrivateKeyFileLocation()

No parameters. Returns the private key file location string.

Returns:

Returns the private key file location string.

PrivateKeyPassphrase

String PrivateKeyPassphrase()

No parameters. Returns the current private key passphrase string.

Returns:

Returns the current private key passphrase string.

RootCertificatesLocation

String RootCertificatesLocation()

No parameters. Returns the root certificates file location string.

Returns:

Returns the root certificates file location string.

SetCertificateFileLocation

Integer SetCertificateFileLocation( String filepath )

Sets the location of the local certificate file to be used for SSL negotiations. This file may also contain the private key. The expected file format is PEM.

Parameters

filepath

Fully qualified filepath to the certificate file.

Returns:

Returns 0 for success and -1 if an error occurred.

SetCipherList

Integer SetCipherList( String cipherList )

Don't mess with this unless you really know what you're doing. Default is "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH". Conforms to OpenSSL conventions.

Parameters

cipherList

cipher list to use

Returns:

Returns 0 for success and -1 if an error occurred.

SetPrivateKeyFileLocation

Integer SetPrivateKeyFileLocation( String filepath )

Sets the location of the private key file to be used for SSL negotiations.

Parameters

filepath

Fully qualified filepath to the private key file.

Returns:

Returns 0 for success and -1 if an error occurred.

SetPrivateKeyPassphrase

Integer SetPrivateKeyPassphrase( String passPhrase )

The passphrase parameter is used if your private key file is also password encrypted.

Parameters

passPhrase

private key passphrase.

Returns:

Returns 0 for success and -1 if an error occurred.

SetRootCertificatesLocation

Integer SetRootCertificatesLocation( String filepath )

The file parameter can be either a directory where the CA certificates are stored or a filename of a PEM format file that contains the root CA certs.

Parameters

filepath

Fully qualified filepath to the certificate file or fully qualified directory path.

Returns:

Returns 0 for success and -1 if an error occurred.

SetVerificationDepth

Integer SetVerificationDepth( Integer depth )

The depth param is a number from 1 to 9 ( the maximum depth ) for how deeply into the cert tree the validation will proceed. Default is 9.

Parameters

depth

The depth param is a number from 1 to 9 ( the maximum depth ) for how deeply into the cert tree the validation will proceed. Default is 9.

Returns:

Returns 0 for success and -1 if an error occurred.

SetVerificationFlag

Integer SetVerificationFlag( Integer flag )

The flag parameter can be either SSLOptions.VERIFY_NONE or SSLOptions.VERIFY_RELAXED. Default is SSLOptions.VERIFY_RELAXED.

Parameters

flag

Fully qualified filepath to the certificate file or fully qualified directory path.

Returns:

Returns 0 for success and -1 if an error occurred.

VerificationDepth

Integer VerificationDepth()

No parameters. Returns the current verification depth or -1 if an error occured.

Returns:

Returns the current verification depth or -1 if an error occured.

VerificationFlag

Integer VerificationFlag()

No parameters. Returns the current verification flag value or -1 if an error occurred.

Returns:

Returns 0 for success and -1 if an error occurred.

 Copyright © 2021 OpenText Corporation. All rights reserved.