SSL connections in PowerBuilder
PowerBuilder provides two system objects for use with secure
connections:
- SSLServiceProvider
service object The SSLServiceProvider object is an implementation of the EAServer CtsSecurity::SSLServiceProvider interface.
For more information about this interface, you can view the EAServer interface repository documentation
in a Web browser by connecting to your server at http://hostname:portnumber.
You use the GetGlobalProperty and SetGlobalProperty functions
of the SSLServiceProvider object to configure global SSL properties. For a description
of the global properties you can set and/or get, see “SSL properties”.You can also set SSL properties at the connection level by
specifying them in an options string for the Connection or JaguarORB
object. Interactive applications typically use the SSLServiceProvider
object in conjunction with the SSLCallback object. Applications
that run without user interaction typically configure SSL settings
at the connection level. For information about setting properties
at the connection level, see “ORB properties”. - SSLCallback object To enable EAServer to request
additional information from the client using a callback method,
you can implement your own logic for the callback methods in an
instance of the SSLCallBack object. The SSLCallback object is an
implementation of the EAServer CtsSecurity::SSLCallback
interface.
SSL properties
Table 25-1 lists
the properties that can be set or retrieved using SetGlobalProperty or GetGlobalProperty.
For any SSL connection, you must set the qop (quality of protection)
property and, unless you implement a callback to obtain it, you
must also set the pin property. You also need to connect to a server
address that can support your chosen level of security, as described
in “Secure server addresses”.
Setting global properties in a PowerBuilder session When you run a client application in PowerBuilder, you can
set global properties only once during the
PowerBuilder session. You will need to restart PowerBuilder each
time you test the code that sets global SSL properties.
If some properties are
not set or are set incorrectly, an SSL callback method is invoked.
If you do not specify an instance of the SSLCallback object, the default
callback implementation aborts the connection attempt.
Property | Description | Get | Set |
---|---|---|---|
callbackImpl | Instance of the SSLCallback object. For more information, see “Using SSL callbacks”. |
Yes | Yes |
certificateLabel | The client certificate to use if the connection requires mutual authentication. The label is a simple name that identifies an X.509 certificate/private key in a PKCS #11 token. Required for mutual authentication. If not set and the connection requires |
Yes | Yes |
qop | The name of a security characteristic to use. Required for SSL. See “Choosing a security characteristic” for more information. |
Yes | Yes |
cacheSize | The size of the SSL session ID cache. Default is 100. |
Yes | Yes |
SessLingerTime | The number of seconds that a session ID entry is kept in the cache after the last connection that used it is terminated. Default is 28800 seconds (8 hours). |
Yes | Yes |
SessShareCount | The number of concurrent SSL sessions that can use the same session ID. Default is 10. |
Yes | Yes |
pin | The PKCS #11 token PIN.
This is required for logging in to a PKCS #11 token If not set, set to any, |
No | Yes |
availableQop | A list of available security characteristics. The qop property can be set only to values that appear in this list. |
Yes | No |
availableQopDesc | A list of descriptions for the available security characteristics, in the same order as listed in the value of the availableQop property. |
Yes | No |
availableVersions | A list of SSL protocol versions supported by the SSL runtime engine. |
Yes | No |
entrustReady | TRUE if Entrust PKI software is available on the client, FALSE otherwise. |
Yes | No |
entrustIniFile | The path name for the Entrust INI file that provides information on how to access Entrust. Required when the useEntrustid property is set to true. If not set, the getCredentialAttribute callback |
Yes | Yes |
entrustUserProfile | The full path to the file containing an Entrust user profile. Optional when the Entrust single-login feature is available, required otherwise. If not set, the getCredentialAttribute callback |
Yes | Yes |
useEntrustID | Whether to use the Entrust ID or the Sybase PKCS #11 token for authentication. This is a boolean property. If this property is set to FALSE, Sybase PKCS #11 |
Yes | Yes |
entrustPassword | The password for logging in to Entrust with the specified user profile. Optional when the Entrust single-login feature is available, required otherwise. If the password is required but not set or set incorrectly, |
No | Yes |
Choosing a security characteristic
To use SSL, you must specify the name of an available security
characteristic for the qop property. The characteristic describes
the CipherSuites the client uses when negotiating an SSL connection.
When connecting, the client sends the list of CipherSuites that
it uses to the server, and the server selects a CipherSuite from
that list. The server chooses the first CipherSuite in the list that
it can use. If the server cannot use any of the available CipherSuites,
the connection fails.
The EAServer documentation
describes the security characteristics that are provided with EAServer. You can retrieve a list
of characteristics available on the server and their descriptions
by retrieving the availableQop and availableQopDesc properties with GetGlobalProperty.
Secure server addresses
You can connect only to a server listener that uses a security
level that is equivalent to or greater than the level requested
in the qop setting. If you use JaguarORB.string_to_object to
instantiate a proxy for the SessionManager::Manager interface, the
listener specified by the server address must use a security profile
that matches the client’s qop setting.
ORB properties
When you connect to EAServer using
either the Connection object or the JaguarORB object, you are using
the EAServer client ORB. You can
set its properties in the Options string of the Connection object
or using JaguarORB’s Init function.
These are the ORB properties that apply specifically to secure connections:
- ORBqop
- ORBcertificateLabel
- ORBpin
- ORBuseEntrustID
- ORBentrustPassword
- ORBentrustIniFile
- ORBentrustUserProfile
The meaning of each of these properties is the same as that
of the corresponding SSL property, but the value affects only the
connection that is being established and not the entire session.
Set ORBqop to sybpks_none to prevent
any use of SSL on a connection. This setting is useful if you have
set the QOP globally for all ORBs using the SSLServiceProvider object,
and you want to override the QOP for a single connection.
For a complete list of ORB properties, see the Help for the
Connection object.
This example sets the ORBqop property to sybpks_simple
and specifies a log file:
1 |
myconnect.options = "ORBqop='sybpks_simple', " &<br /> + "ORBLogFile='C: mplog.txt'" |