ECN-4687 New functions to support HTTP servers that require a login

Product: ACUCOBOL-GT

Module: rmnet.dll

Machines Affected: All

DESCRIPTION:

The HttpSetUsername, HttpSetPassword, HttpSetLoginOptions, and HttpSetSSLVersion function calls have been added to support HTTP servers that require a login a login.

HttpSetUsername
This function sets the CURLOPT_USERNAME option value to the string specified. See also the HttpSetPassword and HttpSetLoginOptions function topics.
Usage
CALL "HttpSetUsername" USING
         user-name
         GIVING
         response-status.
Parameters
user-name An alphanumeric item specifying the user name to use in authentication. Trailing spaces are removed from the value and then the value is zero terminated.
response-status A status code that, if nonzero, indicates the request encountered an error. In this case, the string representation of the error may be obtained by calling NetGetError.
HttpSetPassword
This function sets the CURLOPT_USERNAME option value to the string specified. See also the HttpSetUsername and HttpSetPassword function topics.
Usage
CALL "HttpSetPassword" USING
         password
         GIVING
         response-status.
Parameters
password An alphanumeric item specifying a password to use in authentication. Trailing spaces are removed from the value and then the value is zero terminated.
response-status A status code that, if nonzero, indicates the request encountered an error. In this case, the string representation of the error may be obtained by calling NetGetError.
HttpSetLoginOptions
This function sets the CURLOPT_USERNAME option value to the string specified. See also the HttpSetUsername and HttpSetPassword function topics.
Usage
CALL "HttpSetLoginOptions" USING
         login-options
         GIVING
         response-status.
Parameters
login-options An alphanumeric item specifying the login options to use in authentication. This can be used to specify protocol specific options such as the preferred authentication mechanism. Trailing spaces are removed from the value and then the value is zero terminated.
response-status A status code that, if nonzero, indicates the request encountered an error. In this case, the string representation of the error may be obtained by calling NetGetError.
HttpSetSSLVersion
This function sets the CURLOPT_SSLVERSION option to the specified value, which represents the preferred TLS/SSL protocol version to use when attempting to connect to the server.
Note: If a call to HttpPost results in an SSL connect error (007 return status), and you suspect that the server does not support TLS negotiation, try adding the following call after calling NetInit and before calling HttpPost.
call "HttpSetSSLVersion" using "SSLv3" giving response-status.
Usage
CALL "HttpSetSSLVersion" USING
         version-string
         GIVING
         response-status.
Parameters
login-options An alphanumeric item or literal specifying the SSL version to use. Valid values include:
  • SSLv2
  • SSLv3
  • TLSv1
  • TLSv1_0
  • TLSv1_1
  • TLSv1_2

Trailing spaces are removed from the value and then the value is zero terminated.

Note: If you specify a value other than one of these valid values, the default value of CURL_SSLVERSION_DEFAULT is used, which causes the client to attempt to determine the remote TLS/SSL protocol version.
response-status A status code that, if nonzero, indicates the request encountered an error. In this case, the string representation of the error may be obtained by calling NetGetError.