SSL_CLIENT_WRITE Function
Writes a PV-WAVE STRING to an established SSL connection.
Usage
nbytes = SSL_CLIENT_WRITE(connection, data)
Input Parameters
connection—An SSL_BIO_CTX structure containing the connection information returned by SSL_CLIENT_CONNECT Function.
data—A PV-WAVE STRING containing the instructions for the server.
Returned Value
nbytes—The number of bytes written to the connection stream.
Keywords
None.
Discussion
The command string used in the example ssl_demo.pro (which can be found in the SSL_connect lib directory) sends three HTTP commands to the server:
*A GET command to invoke the CGI-BIN script on the server, along with arguments to the script and the specification of the HTTP version.
*A command specifying the host name of the server.
*A command to close the connection.
These commands are placed in a single PV-WAVE STRING with carriage return and new-line characters between each command to separate them for the server. The '\r' and '\n' characters in the string are replaced by their hexadecimal ASCII equivalents so they pass through without interpretation on the PV-WAVE side. The STRING ends with another set of the carriage return and new-line characters to signal the end of the commands.
For example, the three commands from the ssl_demo.pro file:
"GET /cgi-bin/randbyte?nbytes=32&format=h HTTP/1.1\r\n"
"Host: www.random.org \r\n"
"Connection: close \r\n\r\n"
Become a single PV-WAVE STRING with the hexadecimal substitutions:
"GET  /cgi-bin/randbyte?nbytes=32&format=h HTTP/1.1\x0D\x0AHost: www.random.org \x0D\x0AConnection: close\x0D\x0A\x0D\x0A"
Note that there should be no spaces between the sets of carriage return and new-line characters and the next command.
Example
For more information and to see this process in use, see the file ssl_demo.pro in the SSL_connect lib directory.
See Also