Tuesday, April 14, 2015

VUGen replay errors for HTTPS sites

Problem Statement: Now as most of the sites are migrating to HTTPS; during replay of these application(s) / sites you might see some errors as mentioned below; you can follow the solutions given to resolve the same.

Solution:

Below are a list of Errors encountered and their resolutions for the same:
Error: "--27776: Server "[server_name]" shut connection during attempt to negotiate SSL session"
To resolve this issue, you can reduce the amount of connections simultaneously opened to a Web server by using the following statement in the script:
web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1");
Also, make sure that Keep-Alive is set to "No." This setting can be found via Run-Time Settings -> Preferences -> Options -> Keep-Alive HTTP Connections.

Error: "Error -27781 Timeout in state STATE_SSL_CONNECT "
Error: -27778 : SSL protocol error when attempting to read with host

There are some possible work-around for the above 2 errors, you need to check which one (or combination) works for you:
1. Add the following statement to the beginning of the script:
        web_set_sockets_option("SSL_VERSION", "3");
You can check the SSL Version in your recording log of the script, it can be TLSv1.1 / 1.2 or SSL3; accordingly you can change the command mentioned above.

2. Add web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1"); at the very beginning of the script.

This forces a single connection to the server thus eliminating the possibility of the server prematurely shutting down an existing connection and causing errors when LoadRunner sends data using that connection.

3. Disable webpage breakdown if HTTPS protocol (SSL) is being used and there is a proxy server in-between the client (LoadRunner) and the server under test. To disable webpage breakdown from the Controller:

   a. Go to Diagnostics->Configuration.
   b. Select "Disable" tab for "Web Page Diagnostics"
   c. Click "OK" to close the diaglogue to complete the setup

4. If you have generated your script using WinInet options then use the WinInet Replay engine. To do so, go to Run-Time Settings -> Preferences -> Select "WinInet Replay Engine instead of Sockets (Windows Only)."

Error: "SSL State: error in SSLv3 write client certificate B..." while replaying in Socket mode
Error: "SSL protocol error when attempting to connect with host" while replaying a Web protocol script

Add all of the certificates in the certificate hierarchy for the SSL certificate to a .pem file (e.g. certFile.pem) and include this .pem file by adding the following line at the beginning of the script:
web_set_certificate_ex( "CertFilePath=certFile.pem", "CertFormat=PEM", ...LAST);
web_set_sockets_option("LOAD_VERIFY_FILE", "certFile.pem");

Error -27791 : "server name" has shut down the connection prematurely

To Resolve this, you can try adding the below command:
web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1"); at the very beginning of the script.
If you still get the same error then you can try the below command (add it after the previous one):
web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN", "1")

Error: SSL protocol error when attempting to connect with host "xxx"

Try to check the certificate and connection using openssl with this sentence from CMD:
                       openssl s_client -connect :2443
               or
                       openssl s_client -connect :443

This will show the certificate information. If not, application has a certificate problem and need to check with application owners / server admins.

1 comment:

  1. Error -27778: SSL protocol error when attempting to connect with host "198.161.14.25" [MsgId: MERR-27778]


    Even after having this in code web_set_sockets option is not working. And even I have tryed with all the solutions mentioned above.

    Let me if you have Any code to shift from sockets to WinInet

    ReplyDelete