Hi,
I need to do an https call to one of our partner from the IS.
The IS only acts as a client, and our partner is the server.
Our partner provided us with their certificate (and URL), in a .pfx format. I already converted this file into a .cer format with windows explorer, and converted into a .der format with the webMethods Certificate Toolkit.
I read loads of the Threads and documentation, but the mix of information when webMethods is acting as a client or as a server is very confusing for me.
In my case, I only need to do https outbound calls using our partner certificate.
Do I need to install the certificate within the IS, and if yes how, by importing it (Configure Client Certificates)?
Do I also need to edit the Certificates Settings (Outbound SSL Certificates and Trusted Certificates)?
Can I use the service pub.client.http on its own, or do I need to use the service pub.security:setKeyAndChain?
If yes, the service pub.security:setKeyAndChain has a mandatory private key input, but my partner only provided me with a certificate! How do I populate this field?
IS properties are also so many.
Do I need to set some of those:
> The IS only acts as a client, and our partner is the server.
In this case, you only need to do the following:
Install your partners root and intermediate CA certificates in IS trusted CA certificates directory (look in ‘Security > Certificates’ if you don’t know where that directory is). You will need to restart your server.
Setup your server SSL certificates properly (again, see ‘Security > Certificates’)
Use pub.client:http to establish an HTTPS connection - this will automatically use your server certificate as a client certificate.
You should not need to import a client certificate, change server.cnf etc.
The most valuable advice I can give you: setup an in-house test harness: on a second IS server, setup a SSL port with a ‘require client certificates’ setting, import your server cert as a client certificate mapped to a test user, and start testing…
I installed our partner certificate in our IS trusted CA certificates directory (step 1).
Concerning step 2, do we really need to configure the Outbound SSL Certificates? If yes, this means my company aslo has to get a certificate from CA like VeriSign or Entrust? But once again, our partner never sends request to us.
Michael - The title of your thread: “Https call with certificate” led me to believe your tranding partner requires X.509 client certificate authentication when your server connects to their server? If not, and you are using Basic Authentication or no authentication at all, you don’t need to do step #2. It should just work.
Settings/Extended:
I didn’t setup any of the watt.security properties.
Security/Certificates:
I didn’t specified any Trusted Directory
I didn’t specified any Outbound SSL Certificates
I didn’t import (configure) any Client Certificates
From the flow service:
pub.security:setKeyAndChain:
Points to the private key which I extracted from the certificate (.der)
Points to the certificate (.der)
Pub.client.http
Points to the https url
Method POST
pub.security:clearKeyAndChain
That’s it.
But it was first needed to extract the private key from the certificate we received!
To do so, we used open ssl (openssl.exe pkcs12 -in certificate.pfx -out outfile)
We extract the private key section from the PEM default format
We did convert the key into a .der format (openssl rsa -inform PEM -outform DER -in privKey.pem -out privKey.der)
Hope this will help someone in the future.
Michael.
> pub.security:setKeyAndChain:
> Points to the private key which I extracted from the certificate (.der)
> Points to the certificate (.der)
So you are using X.509 digital certificate client authentication.
Most setups use their server certificate as a client certificate as well. Hence if you set the server certificate in ‘Security > Certificates’ as under:
Outbound SSL Certificates
Server’s Signed Certificate = PUBLIC.KEY.DER
Signing CA’s Certificate = thawte.crt
Server’s Private Key = private.der
Trusted Certificates
CA Certificate Directory = <whatever>
… you can avoid the call to setKeyAndChain entirely - the HTTP client will automatically use your server cert for X.509 client authentication.
Sonam,
You are right!
We can also do it without using setKeyAndChain but using Outbound SSL instead.
But why do we have to extract the private key from the certificate our partner provided us? So tricky! We have to use open ssl to extract the private key and to convert it into der. Not very straight forward, isn’t it!
Thanks to you,
Michael.
You’re welcome Michael.
Normally, the partner won’t provide you a certificate, it will be the other way around.
I think this is the normal sequence for key generation:
You generate a private key - this stays secret at all times and is only known to you. It is not provided to your partners, and not even to the CA.
You generate a certificate signing request (CSR) using your private key.
You send off the CSR to the CA, who signs it and sends back your public certificate, as well as the CA’s public certificate.
You send off your newly signed public certificate, as well as the CA’s public certificate, to your partners. Your partners set their system to ‘trust’ your CA (if they don’t do so already) and ‘map’ your public certificate to your account on their system.
Now, your system can use the private key to authenticate a request from your system to your partner’s system - your partner will be able to authenticate you as only your public key can decrypt communication encrypted with your private key.
You said your partner provided you with the certificate in a .pfx format. I’m not conversant with that format, but what may have happened, is some companies are very strict on X.509 authentication. In order to save time and skip steps #1-4 above, your partner may simply have procured/generated a certificate for you - but that may mean they have your private key for the certificate.
I am trying to do a “get” call by hitting “https://URL:9001/xyz” link. It is Enovia CAS server. i am passing all parameters correctly but getting below error.
Error Message:
400 Bad Request
Bad Request
Your browser sent a request that this server could not understand.
I am using pub.client:http service to hit above link. Other team is telling to bypass self signed certificate and send request. So please may i know how do i ignore or bypass self signed certificate."
"pub.security:setKeyAndChain:
Points to the private key which I extracted from the certificate (.der)
Points to the certificate (.der) "
I did not understand above points. please can you share inputs what i have to give to “pub.security.keystore:setKeyAndChain”
Inputs:
keyStoreAlias
keyAlias
As already answered in another post with similar subject, certificate handling in IntegrationServer has changed with wM 8.x and newer in comparison to previous versions.
You will have to create a JavaKeyStore-File (JKS) with all the certificates you want to trust and configure this one as a Truststore in your IS.
Keystore file can be created by using keytool, which is part of every jvm distribution.