Making HTTP API calls with a self-signed server certificate


I’m attempting to make some HTTP API calls to an internal server that uses a self-signed certificate via UiPath.WebAPI.Activities 1.7.0, and consistently running into the error “The underlying connection was closed: could not establish trust relationship for the SSL/TLS secure channel.”

This isn’t surprising in and of itself, but it seems to be surprisingly difficult to work around.

I tried setting ContinueOnError to True for the HTTP Request activity in question, but this does not seem to have changed anything.

I did find what looks like a possible solution in another topic here, but am having some trouble implementing it. When I try to use the code provided there, I get the following validation error:

Error	ERROR	Validation Error	No compiled code to run
error BC30452: Operator '+' is not defined for types 'System.Net.Security.RemoteCertificateValidationCallback' and 'String'. At line 1
error BC30198: ')' expected. At line 2	Main.xaml

I feel like I’m missing something straightforward in getting this to work, particularly as I suspect this is a fairly common problem to solve, but could use some help getting there. Is anyone able to point me in the right direction - either understanding and getting that code snippet working, or towards a better general solution to getting the API requests to work (bearing in mind I don’t have any ability to change the configuration of the server I’m sending requests to)?

Thanks in advance

1 Like

Hey @Mike_Kurc

Have you installed the same self signed certificate in the client machine from where you are making a call to it ?


Nithin: I haven’t, no, and I’m currently not able to do so (if it’s possible, it would involve a lot of red tape). While that might be an option in the future (and would be one of the better solutions) while we get our feet wet with UiPath as an organization I am hoping to find a way to work without that for now.

1 Like

You may need to install domain based certificate at the server side to avoid this, which is one more workaround.