Windows Socket Protocol - SSL Required so using lrs_start_ssl - How Can I Add The Correct Certificate to this Request

Hi all,

We are using the Windows Socket Protocol to script an interface that requires SSL we have found the lrs_start_ssl function that allows to do the SSL Handshake however it is not completing that handshake successfully and we are getting the below error - 

SSL error code: 1, result code -1
SSL: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
Error : Function execution failed. Error code : 9001.

Talking with the engineers for the System Under Test they say that we are not presenting a certificate - so my question is how do I add a certificate to this request or control which certificate is used by this request?

We are using Virtual User Generator Version 2022 build 433

  • 0  

    This error indicates that a client certificate is required in this handshake.

    I suggest to capture a wireshark log for your network connection (without vugen recording) and check if a certificate is required or not (sslkey may be required to deprecate the data); you can also capture the network data for vugen recording and do a comparison to see what is missed in your script.

  • 0 in reply to   

    Thank you for the reply, unfortunately we do not have access the the application that interfaces over TCP with our System Under Test so we cannot record the traffic from the application over wireshark or via vugen. 

    We have had to manually put the request together and ensure the TCP connection is correct via working with the System Under Test Engineers - we know a client certificate is required from discussing with those engineers we just don't know how to make vugen present a certificate as it is currently not sending anything, is there a way to add a certificate to a handcrafted socket / request?

  • 0   in reply to 

    ,

    You might explore the function web_set_certificate_ex() and SSL Utility.

    How to ask questions

    Reward contributions via likes or 'verified answers'

  • 0 in reply to   

    Does the  web_set_certificate_ex() function work on a Windows Sockets protocol script?

  • 0 in reply to   

    Hi     would need you help.

    I'm getting same error where I need to Test an rest API below are the observation

    1. By Adding Client certificate (certificate file) and disabling/turning off SSL certification verification in postman request works fine.

    2. When I run the script from Vugen I'm getting below error

     Error -27774: SSL protocol error when attempting to connect with host "hostname" [MsgId: MERR-27774]
    Action.c(42): Error -27760: Request

    ssl_handle_status encounter error : SSL_ERROR_SSL, error message : error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure.

    Tried using different SSL version  (TLS1.2, TLS1.3, 3, 2&3): web_set_sockets_option("SSL_VERSION", "TLS1.2");  know handshake is failing but same thing works in postman.