Today I have been continuing work on integrating RPA Blue Prism with Confluent Kafka. I mentioned in my earlier post that I connect to Kafka Rest Proxy by using Utility – HTTP business object with HTTP Request action. Blue Prism consumer authenticates to Kafka by using SSL certificates. I use self-signed SSL certificate on my Kafka test environment and as a result an error occurs while executing HTTP Request action.
ERROR: Internal : Could not execute code stage because exception thrown by code stage: Object reference not set to an instance of an object.
I found two ways how to mitigate this issue.
Import self-signed certificate in Windows Certificate Manager
Certificate Manager can be opened by executing certmgr command line in Windows Command Prompt.
Go to Trusted Root Certification Authorities->right click-> All Tasks -> Import…
Certificate Import Wizard is opened. Choose your certificate from disk
Press Next, confirm that certificate should be imported to Trusted Root Certification Authorities store, click Finish and confirm that you want to install certificate. New certificate should be visible in Trusted Root Certification Authorities->Certificates folder.
And that’s all. HTTP Request action should be working now.
Modify Visal Basic code to accept self-signed certificates
But there is another more portable option from Stackoverflow post. Open Utility – HTTP object, go to Initialise tab and change the Setup code by adding
System.Net.ServicePointManager.ServerCertificateValidationCallback = _<br> Function(se As Object, _<br> cert As System.Security.Cryptography.X509Certificates.X509Certificate, _<br> chain As System.Security.Cryptography.X509Certificates.X509Chain, _<br> sslerror As System.Net.Security.SslPolicyErrors) True
Blue Prism should not complain anymore on self-signed certificates.