Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..
3956 views

web_set_certificate_ex function

I have a request to monitor some web services and I have created scripts using the web_custom_request function. Here is an example

    web_custom_request("myrequest",         // Layer 7 URL         

"URL=https://www.url",        

 "Method=POST",         

"Resource=0",         

"RecContentType=text/xml",        

 "Referer=",         

"Snapshot=t1.inf",         

"Mode=HTML",        

 "EncType=text/xml;charset=UTF-8",

   "Body=<soapenv:Envelope xmlns:soapenv=\"http://XXXX/\"  xmlns:aaa=\"http…  " <soapenv:Header>\n"      " SOAP request…  

I have not had any problems in the past as I have always been able to paste in the soap request and URLs and have been able to validate the SOAP response.

My last attempts have been unsuccessful because of the presence of this in the SOAP response:

<reasonText>No signature in message!</reasonText>

The app dev team said I needed a certificate. I created a cert and followed the procedure in the Function reference for web_set_Certificate _ex to put it in .pem format. I then put the cert in the script folder.

This is what I put in code:

web_set_certificate_ex(      

"CertFilePath=mycert.pem",      

"CertFormat=PEM",       

"KeyFilePath= mycert.pem ",     

 "KeyFormat=PEM",       

//"Password=woowoo",      LAST );

I am still getting the same No signature in message! in the response. In case my understanding of script folder was not correct, I tried specifying a folder on the c drive for the file and key path, still got the same response. The log say “web_set_certificate_ex was successful”. In fact, the log will say  web_set_certificate_ex was successful even if I put complete nonsense in as the arguments.

How do I get web_set_certificate_ex to work or at least provide a reasonable message if it is not working.

I can try running this as winnet replay rather than sockets, in which case I’d only need to enter the cert Index from IE. How do I determine the cert Index?

 

I am using Vugen v 12.02, build 2739

 

Thanks,

Dave

0 Likes
1 Reply
Highlighted
Regular Contributor.
Regular Contributor.

Re: web_set_certificate_ex function

In you version (12.02), the index is a little tricky to determine. You can open the certificate store in IE and check the thumbprint value. The certificates are stored in the system sorted by this value (descending order). 

Or you can open a page that require the client certificate and check the index from the pop out window by your browser.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.