Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
System SSL client program z/OS Cryptographic Services System SSL Programming SC14-7495-00 |
|
The socket and System SSL API calls used by the client program are very similar to the calls used by the server program. Rather than accepting connections like a server program, a client program connects to the server program. To create a stream socket that the client program can use to connect to the server, use this function call:
Now that the client program socket is created, connect the socket to the server program port using this function call:
After successfully connecting to the server program, the client program must establish the secure socket connection. This connection causes the SSL handshake to be performed. Once the handshake is complete, secure communication of the application data can be done. This example code establishes the connection using these attribute values:
The System SSL program should provide the function to send and receive data over the application socket. For more information, see I/O routine replacement. Use these function calls, send() and recv(), to send and receive the application data.
After the client program successfully calls gsk_secure_socket_init(), it can now read and write data securely over the application socket. To read application data from the application socket, use this code:
To write application data over the application socket, use this code:
Once the client program is finished using the application socket to securely send and receive data, it must free all of the System SSL resources for the SSL session and close the socket. To free the System SSL resource for the SSL session, use the gsk_secure_socket_close() call:
To free the resources used by the SSL environment, use the gsk_environment_close() call:
Finally, to close the application socket, use this function call:
|
Copyright IBM Corporation 1990, 2014
|