1

Hi i am using requests to send a post request to a website but it is giving me ssl error here is how i am trying

import requests
headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'en-US,en;q=0.9,ur;q=0.8,bg;q=0.7',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json',
    'Origin': 'https://example.com',
    'Referer': 'https://example.com/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
    'dnt': '1',
    'sec-ch-ua': '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-gpc': '1',
}
json_data = {
    'session':'123'
}
response = requests.post(
    'https://example.com',
    headers=headers,
    json=json_data
)
print(response.content)

And here is error

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\John\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='exammple.com', port=443): Max retries exceeded with url: /data (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1002)')))

I tried doing this like verify=False and verify=server.cer but error is not going. The site is using Godaddy root certificate when i checked and i experted that certificate from my browser my same error coming. When i try in browser or using proxy intercepter like burpsuite i am able to send and receive the responses but it is not going. I tried searching on google and finding many solution but nothing works. I tried to convert the certificate to .pem but it does not helped. Can you help me to solve this issue please.

Risen_Star
  • 53
  • 3

0 Answers0