cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enable SSL in TestComplete

Contributor

How do I enable SSL in TestComplete

I am trying to enable SSL in TestComplete but I am stuck.

 

Note: We are not using ReadyAPI nor are we using SOAPUI for generating our tests.  Although I do have both working with SSL enabled.  The direction of our development is through TestComplete and we are not using the ReadyAPI or Webservices module within TC.

 

I am able to set up the aqHTTP authentication on each service but I am stuck and how to use and get access to the local Certificate.

 

Suggestions or comments?

 

Tags (3)
5 REPLIES 5
Highlighted
Community Hero

Re: How do I enable SSL in TestComplete

Hi,

 

Can you describe your use case?

TestComplete does not use SSL in any way, thus there is no way to enable or disable it in TC itself.

aqHTTPRequest object can be used to issue both http and https requests, but it is required that all underlying infrastructure is set up properly (valid certificates are installed, proxy is configured, etc.).

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: How do I enable SSL in TestComplete

@AlexKaras 

Thank you for responding

 

OK.  Here is the code where the Authentication happens within the Header but I believe I need help with a different layer and that is trying to figure out how to get the certificate to be read.

Here is the TC ERROR "An unknown error occurred while processing the certificate."

 

How do I install the certificate and do I need a proxy?  The certificate is currently just sitting on my C: drive

 

What do you mean by setting up the infrastructure?  Is this adding something to the default browser or possibly in TC itself?

 

 

try

{

RequestType = aqString.ToUpper(WebServiceData["ServiceType"]);

// Create an aqHttpRequest object

var aqHttpRequest = !equal(WebServiceData["UserName"],undefined) ? aqHttp.CreateRequest(RequestType, WebServiceData["Address"], WebServiceData["UserName"], WebServiceData["Password"]) : aqHttp.CreateRequest(RequestType, WebServiceData["Address"]);  

// Specify the Content-Type header value

aqHttpRequest.SetHeader("Content-Type", "application/" + aqString.ToLower(ContentType));

aqHttpRequest.SetHeader("Accept", "application/" + aqString.ToLower(ContentType));

//Added for Authentication

var credentials = aqConvert.VarToStr(dotNET.System.Convert.ToBase64String

(dotNET.System_Text.Encoding.UTF8.GetBytes_2(Project.Variables.SSL_Login + ":" + Project.Variables.SSL_Password)));

aqHttpRequest = aqHttp.CreateGetRequest(WebServiceData["Address"]);

aqHttpRequest.SetHeader("Authorization", "Basic " + credentials);

aqHttpRequest.SetHeader("X-Request-Id", "Andrew");

// Send the request, get an aqHttpResponse object

var aqHttpResponse = (equal(RequestData,"")) ? aqHttpRequest.Send() : aqHttpRequest.Send(RequestData);

 

Community Hero

Re: How do I enable SSL in TestComplete

Hi,

 

> How do I install the certificate [...]?

Well... To my knowledge, it depends on the application that uses it. Regular Windows applications usually require certificate to be installed into the system or user storage and used from there. Jave applications store certificates in the file. So I would recommend to check this with your developers.

 

> aqHttpRequest.SetHeader("Authorization", "Basic " + credentials);

Basic authorization does not require any certificate but only user name and password, like in your code.

 

Unless you had a reason to create the code that you provided, I would recommend to use some traffic recording tool (Fiddler, for example) and record the traffic from the application. Analyze recording then and replicate it in your test code.

 

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: How do I enable SSL in TestComplete

@AlexKaras ,

 

We are using both types. 

 

aqHttpRequest.SetHeader("Authorization", "Basic " + credentials);

I believe this Authorization is used for LDAP with a un/pw

 

and the other is for the HTTPS and a secure handshake from client to server.

 

I see in SOAPUI it is straight forward to add the SSL cert into the Preferences and also add Basic Authentication to the header but in TC I can add the Basic Auth into the header through the aqHttpRequest but the CERT is not so straight forward.

 

Can i assume that the CERT could be added to IE or someother location where certicates are read from?  If true how does it know the password.  Is the file system just set up to handle it if the cert is in the correct location?

 

Andrew

 

Contributor

Re: How do I enable SSL in TestComplete

Hello @AlexKaras ,

 

I believe I have imported the Certificate into the correct location through IE.  Although I believe the company already had them set.

 

Here is an ERROR that I am receiving.  How can I be sure that TC is grabbing the correct cert, or which cert, or what cert location it is connecting to?

 

Error: No credentials were available in the client certificate