sslhandshakeexception detailed explanation using pem, p12 or cert and key format with REST Assured

preview_player
Показать описание
In this video I will cover :

how to use client certs if you receive them in a p12 or a pem file or as cert and key.
how to extract cert and key from pem file
how to create p12 using base64 encoded cert and key
how to inspect cert is base64 encoded
how to resolve gitbash openssl unable to take input error
how to use winpty
how to export contents of one p12 to another
how to import p12 into another store

02:58 Downloading ICA RCA using browser

05:30 Truststore with certs

06:10 Adding entry using alias

07:18 Deleting entry using alias

08:26 Using truststore and keystore

08:53 If you received only a pem file

09:13 Extract cert and key from pem file

10:33 Base64 decode a cert to verify that it was encoded using website

12:31 Base64 decode a cert to verify that it was encoded using git-bash; cat /dev/clipboard

13:29 Create p12 using cert and key using openssl

14:02 Openssl command stuck in gitbash or gives 'random state error'

14:16 winpty

15:33 Importing p12 into another store

16:29 Using p12 to copy cert and key to another p12 with password same as the store that we want to import it to

18:19 Import p12 to another store

Supporting Links

Commands

Channel #Rahul Random Learnings #RahulRandomLearnings #RahulRandom Learnings Opinion Disclaimer:
The views and opinions expressed here are my own and not the views of my employer.
The content uploaded on my channel is not intended to malign any religion, ethic group, club, organization, company, individual or anyone or anything.
Рекомендации по теме
Комментарии
Автор

You are create awesome info with many tests, Thanks very much for your efforts,

Seriously I become subscriber because this video

AhmedKhaled-hemf
Автор

Hi Rahul, Good explanation.. keep up the good wrok. I have a question here, I have p12 file as well .cer file and I have configured .cer in trustore and p12 as keystore, but yet i am getting unable to find certificate issue..

aravindsramesh
Автор

Thank you for making this Video Rahul!!! If you ever start a patron membership I will definitely subscribe to it.

testersumanth
Автор

Hi Rahul, Very well explained but I have a scenario that works in Postman and am trying to automate it using Rest assured. There is Host along with cert and key file which I have converted into PKCS12 format and imported into truststore file. So, I need to send cert file along with Host to get the Token. but am getting forbidden error, can you please help on to resolve this issue.

shivyadav
Автор

Great video where can i get the java code i want to experiment with it .

tradfy
Автор

Hi Rahul, I have added Root & Intermediate cert to truststore & have my client cert in p12 format .

I am getting java.io.IOException: Sequence tag error - Can u please let me know what is the root cause for this ?

shivki
Автор

Hello Rahul,
I am trying to resolve SSL handshake exception as well. I have received the certificate for resolving this, which is a .der file.

Do I need to create both keystore and truststore for this? Can you please guide?

kayforkeerthana
Автор

I have got .crt and .key file and also need proxy to create rest assured scripts. Can someone confirm what will be the steps for that?

mohammadrasheed
Автор

Hi Rahul, Thank you for the brilliant explanation. I need help with the following scenario, I have to get a JWT from an endpoint which requires a CA cert( in pem format) and one client certificate (which is in pfx format) .This scenario is working fine in postman but could you please advise on how we can do this is rest assured, should we convert the pfx file into p12? or is there an better approach. Waiting for your response

mjjtube
Автор

Hi, how are you? congratulations on the video... I did the same steps as you, but I'm having the problem: PKIX path building failed: unable to find valid certification path to requested target. I found your channel because I'm having an error in java which is a Mutual Authentication via certificate exchange failing in Java: SSLHandshakeException: Remote host terminated the handshake. Basically java is not sending my .p12 file... I've done everything (this is not a joke) and I can't solve this problem... I even have an issue on stackoverflow... do you think you could help me? cheers!

yvesguilhermebbts
Автор

Hi Rahul, your videos really easy to understand the complex topic.

Can you help on below point:

My customer given p12 file to connect to his secure API (means security enabled at his server end) and need to pass digest token while sending json payload in request. Can you suggest me how to implement this?

I am getting 500 error while testing through postman API?

Any support on this?

AviationIT
Автор

Hi Rahul, Awesome video!!!
I created a PCKS12 keystore and on running the it I am error: Exception in thread "main" javaioIOException: parseAlgParameters failed: ObjectIdentifier() -- data isn't an object ID (tag = 48)

I googled a little and this might be due to I running Java 1.8.0_301. I changed the keystore to JKS and ran it and I am seeing connection timeout error: Exception in thread "main" javanetConnectException: Connection timed out: connect

Can you please help me?

inittolearn
Автор

Please below command:
keytool -list -keystore test.p12

return this error:
keytool error: java.io.IOException: Invalid keystore format

AhmedKhaled-hemf