gsk_secure_soc_startInit()--Start asynchronous operation to negotiate a secure session


  Syntax
 #include <gskssl.h>
 #include <qsoasync.h>

 int gsk_secure_soc_startInit(gsk_handle my_session_handle,
                              int IOCompletionPort,
                              Qso_OverlappedIO_t * communicationsArea)

        
  Service Program Name: QSYS/QSOSSLSR

  Default Public Authority: *USE

  Threadsafe: Yes

The gsk_secure_soc_startInit() function is used to initiate an asynchronous negotiation of a secure session, using the attributes set for the SSL environment and the secure session. This API starts the SSL handshake to the remote peer and upon successful completion of QsoWaitForIOCompletion() a secure session is established.


Parameters

my_session_handle (Input)
The handle returned from gsk_secure_soc_open() that will be used to negotiate the secure session.

int IOCompletionPort (Input)
The I/O completion port that should be posted when the operation completes.

Qso_OverlappedIO_t * communicationsArea (Input/Output)
A pointer to a structure that contains the following information:


Authorities

Authorization of *R (allow access to the object) to the certificate store file and its associated files is required. Authorization of *X (allow use of the object) to each directory of the path name of the certificate store file and its associated files is required.


Return Values

gsk_secure_soc_startInit() returns an integer. Possible values are:


Error Conditions

When gsk_secure_soc_startInit() API fails with return code [GSK_ERROR_IO], errno can be set to:

[EIO]
Input/output error.
[EUNATCH]
The protocol required to support the specified address family is not available at this time.

If an errno is returned that is not in this list, see Errno Values for UNIX®-Type Functions for a description of the errno.


Error Messages


Usage Notes

  1. The gsk_secure_soc_startInit() function is valid only on sockets that have an address family of AF_INET or AF_INET6 and a socket type of SOCK_STREAM.

  2. The current implemention of the SSL Protocol does not allow gsk_secure_soc_startInit() to complete synchronously. Use gsk_secure_soc_init() if the synchronous behaviour is needed.

  3. When doing the SSL handshake with a GSK_SESSION_TYPE value of GSK_SERVER_SESSION, GSK_SERVER_SESSION_WITH_CL_AUTH, or GSK_SERVER_SESSION_WITH_CL_AUTH_CRITICAL, the GSK_CONNECT_CIPHER_SPEC_EX value will be the first cipher found in GSK_TLSV12_CIPHER_SPECS_EX, GSK_TLSV11_CIPHER_SPECS_EX, GSK_TLSV10_CIPHER_SPECS_EX, GSK_V3_CIPHER_SPECS_EX, and/or GSK_V2_CIPHER_SPECS based upon the protocol level agreed to that was also found in the cipher list provided by the client during the SSL handshake.

  4. When doing the SSL handshake with a GSK_SESSION_TYPE value of GSK_CLIENT_SESSION, the cipher specification list will be sent to the server in the client hello in the order found in the GSK_TLSV12_CIPHER_SPECS_EX, GSK_TLSV11_CIPHER_SPECS_EX, GSK_TLSV10_CIPHER_SPECS_EX, GSK_V3_CIPHER_SPECS_EX and/or GSK_V2_CIPHER_SPECS list, however the value from that list that is negotiated for GSK_CONNECT_CIPHER_SPEC_EX is determined by the server policy.

  5. If gsk_secure_soc_startInit() fails, GSK_LAST_VALIDATION_ERROR may be set to provide additional information on the cause of the failure.

  6. gsk_secure_soc_startInit() may result in one or more secondary external TCP connections being made if OCSP has been enabled or configured.


Related Information


API introduced: V5R2