Python Forum
SSL Handshake Failure with Python 3.11 and 3.12
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SSL Handshake Failure with Python 3.11 and 3.12
#1
Hi everyone,

I'm encountering an SSL handshake failure when upgrading my Python application from versions 3.8 and 3.9 to 3.11 and 3.12. The server side uses TLS 1.2. Here are the errors I'm seeing:
Error:
Python 3.12: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1000) Python 3.11: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1006)
I suspect this is due to a mismatch between the server and client protocols. Below is a snippet of my code:

import smtplib
import http.client
import base64
import urllib
import os

host = "xyzabc.coom"
path = "get/FileDetails"


path = f"{SOMEPATH}/{N}/{na}/{encode_fileURL}"

context = ssl.create_default_context()
context.minimum_version = ssl.TLSVersion.TLSv1_2
context.maximum_version = ssl.TLSVersion.TLSv1_2

conn = http.client.HTTPSConnection(host, context=context)
conn.request(method="GET", url=path, headers=headers)
response = conn.getresponse()
conn.close()
I've tried enforcing TLS 1.2 in my code, but the issue persists. Any suggestions on how to resolve this?

Thanks in advance!
buran write Nov-15-2024, 04:24 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 1,394 Sep-22-2023, 01:21 PM
Last Post: buran
  Dickey Fuller failure Led_Zeppelin 4 4,282 Sep-15-2022, 09:07 PM
Last Post: Led_Zeppelin
  Assert failure jtcostel 1 2,237 Sep-03-2021, 05:28 PM
Last Post: buran
  IBM Watson: Handshake status 403 Forbidden or No section: 'auth' groschat 1 3,553 May-07-2021, 03:44 PM
Last Post: jefsummers
  Python long running script - causes RDP failure to server? william101 1 3,089 Jun-08-2020, 08:18 AM
Last Post: nuffink
  xml decoding failure(bs4) roughstroke 1 3,067 May-09-2020, 04:37 PM
Last Post: snippsat
  SCIKIT learn failure in mac Perja11 1 3,232 Nov-30-2019, 06:44 PM
Last Post: snippsat
  failure to find modules justus123 2 5,814 Dec-14-2018, 04:28 PM
Last Post: nilamo
  LIB install failure Able98 2 4,715 Jun-07-2017, 06:41 PM
Last Post: Able98
  WebSocketBadStatusException: Handshake status 307 Susmitha 2 6,026 Apr-24-2017, 04:02 PM
Last Post: Susmitha

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020