Why a Python TLS connection fails on a hybrid post-quantum group
When a Python client or service raises an SSLError or stops at the TLS handshake after a hybrid post-quantum group is offered, the failure is at the ssl context in the Python process, and the developer or service owner who controls that context and the runtime has to act. The connection does not fall back to a weaker method. It simply does not complete, so no data is exchanged. How urgent this is depends on whether the connection sits on a production path. A batch job or a internal tool may tolerate a short delay, while a service that other systems depend on for authentication or data transfer cannot wait. Check which of these applies before changing anything, and record the exact exception text, since the message usually names the stage that failed.
Two facts explain most of the failures teams see. First, SSLContext.set_groups() raises an SSLError with the message "unrecognized group" when OpenSSL rejects a name in the list you pass, so a single misspelled or unsupported name stops the call before any connection is made. The call exists in Python 3.15 and later, and it sends its list to OpenSSL through SSL_CTX_set1_groups_list. Second, a FIPS-enabled OpenSSL build can reject every ML-KEM group name while still accepting classical names such as X25519 and secp256r1. In a reported case on Python 3.13.11 with OpenSSL 3.5.7, every connect() failed with ssl.SSLError: unknown error because the list began with ML-KEM hybrid groups. The sdk maintainers merged a fallback in pull request 853, which ships in v3.0.2, so the first step is to check whether the OpenSSL provider in your build accepts ML-KEM names at all.
Before you change the group list, confirm what your runtime actually supports. Print ssl.OPENSSL_VERSION and check that SSLContext has a get_groups method, since get_groups() needs OpenSSL 3.5 or later and SSLSocket.group() needs OpenSSL 3.2 or later. Then ask your vendor or check your FIPS provider documentation for which group names it accepts. Keep the classical fallback in mind, but treat it as a workaround that must be reviewed, not a fix, because it removes the hybrid key agreement you were asked to enable.
Who has to act on a Python TLS group error
A Python TLS group error is rarely fixed by one person. The application code, the interpreter and OpenSSL build, the host policy and the libraries a team ships each control a different part of the group list, so the first step is to find out which of them is setting it. Each role below states what it can change and what it has to hand to someone else.
Application developer calling set_groups()
The developer who writes ctx.set_groups() decides which key agreement groups a socket may offer. This is the one place the group list is set in the application's own code, so it is the first place to check when a hybrid group such as ML-KEM fails. Confirm that the call is wrapped in a fallback and that the list still includes classical groups such as X25519. Note that set_groups() is available only in Python 3.15 and later, so code running on older interpreters will fail with an attribute error unless it checks for the method first.
Service owner controlling the runtime
The service owner controls which Python interpreter and OpenSSL build the service runs on. Those two choices decide which groups are even available, because OpenSSL must support a group before Python can offer it. Check the output of ssl.OPENSSL_VERSION in the running process, not the version on the build machine. If the service runs a vendor-shipped interpreter, the owner usually cannot upgrade OpenSSL independently and must ask the vendor or wait for a new release.
Platform administrator on shared hosts
On shared or FIPS-enabled hosts, the platform administrator sets the OpenSSL provider and its approved group list for every workload on the machine. A FIPS provider can reject group names that a standard build accepts, which the Splunk report shows: every ML-KEM name was refused while classical names were accepted. Administrators cannot fix this per application without changing the host policy, so they should coordinate any change with the teams whose services depend on it and test on a non-production host first.
Vendor or SDK maintainer
When a third-party SDK sets the groups internally, the service team may not be able to edit that call at all. The maintainer decides the default group list, whether a fallback exists, and which release contains the fix. Check the bundled SDK version against the release notes, because a team cannot upgrade a dependency that is pinned by another package. If the maintainer has not published a fix, ask whether a configuration option exists before you patch the vendor code.
Splunk SDK issueHow to check which OpenSSL and groups Python is using
This sequence shows which OpenSSL build your Python interpreter loaded, which key agreement groups it offers, and which group a live connection actually negotiated. Run these checks before and after changing group settings so you can confirm the change took effect and diagnose handshake failures.
Print the OpenSSL version string
Run a short Python command that prints ssl.OPENSSL_VERSION, which returns the version string of the OpenSSL library this interpreter loaded at runtime. Run it with the same interpreter your application uses, since a virtual environment or a system Python can load a different OpenSSL build. Note the full string, including any FIPS or vendor suffix, because a FIPS-enabled build can reject group names that a standard build accepts. The check is complete when you can name the OpenSSL version your application actually runs with, not the one installed in your operating system.
Read the OpenSSL version as a tuple
Print ssl.OPENSSL_VERSION_INFO, which returns the OpenSSL version as a tuple of five integers. Use this value in your own code when you need to branch on the OpenSSL version, for example before calling a group-related method. This attribute has been available since Python 3.2, so it works on older interpreters where the newer group methods do not exist. The check is complete when you have the major, minor and patch numbers you need to compare against the OpenSSL versions listed in the sources.
Confirm set_groups() exists on the context
Create an SSL context with ssl.create_default_context() and check whether it has a set_groups attribute, for example with hasattr(). The method was added in Python 3.15, so an older interpreter will not have it, and code that calls it unconditionally will raise an AttributeError there. If the attribute is missing, you can skip the group call or wrap it in a try/except, but confirm that the classical fallback still meets your requirements. The check is complete when you know whether this interpreter supports group selection at all.
List the groups the context implements
On Python 3.15 with OpenSSL 3.5 or later, call SSLContext.get_groups() on the context you plan to use. It lists the key agreement groups the library implements for the context's current minimum and maximum TLS versions, and passing include_aliases=True adds alias names. Compare the output with the group names you intend to configure, and confirm that the hybrid group you need appears in it. If the post-quantum group is absent, the OpenSSL build or the TLS version range is the likely cause, so check both before changing your configuration. The check is complete when the list confirms the groups your application can offer.
Apply the group list and check the result
Call SSLContext.set_groups() with the group list in OpenSSL group list format, then run the call inside a test so you can see any failure. If OpenSSL rejects a name, Python raises an SSLError with the message "unrecognized group", so a failure here means at least one name is not known to the loaded library. Prefixing a name with ? tells OpenSSL to ignore it when the implementation is missing, which can help when the same code runs on different OpenSSL builds. The check is complete when set_groups() returns without error on the interpreter and OpenSSL combination you are testing.
Read the negotiated group from a live socket
After a TLS handshake completes, call SSLSocket.group() on the connected socket to read the group used for key agreement. This method needs OpenSSL 3.2 or later and returns None when no connection is established, so check for None before logging the value. Record the group name alongside the server host and port, then repeat the test against each server you need to reach. The check is complete when the output shows the group you expected for each connection, or shows a classical group where you expected a hybrid one.
Enable key logging when the handshake is unclear
If the handshake result does not explain the failure, set SSLContext.keylog_filename to a file path, or set the SSLKEYLOGFILE environment variable before creating the context, so Python writes the TLS keys to that file. create_default_context() turns on key logging when SSLKEYLOGFILE is set. Use this only on a test system, because the file holds secrets that can decrypt the captured session, and delete it when you finish. The check is complete when the log file exists and a packet capture tool can read the matching session.
Recognize the server-side no suitable key share message
If the server logs SSL routines:final_key_share:no suitable key share, it means no usable client key share remained for the group the server selected, so the handshake could not complete. OpenSSL logs this on the server side, and similar rejections have been reported when an older client connected to a server configured for a hybrid group only. Compare the client's offered groups, from get_groups() or your set_groups() call, with the groups the server accepts, and confirm the server supports at least one of them. The check is complete when you can state which group the client offered and which the server required.
Causes of a Python TLS group error and the fix for each
This table matches each error cause to the change that resolves it. Find the message or symptom you see in the first column, then apply the fix in the last column. Start with the name check and the SDK version, since those account for most failures on hybrid groups.
| Cause | How it shows up | Fix |
|---|---|---|
| Group name rejected by the OpenSSL build | set_groups() raises SSLError with "unrecognized group" or the connection fails with an unknown error when the list includes ML-KEM names | Correct the group name or prefix to the form your OpenSSL version supports, and check the name with get_groups() where OpenSSL 3.5 or later is loaded |
| FIPS provider rejects ML-KEM names | On FIPS-enabled OpenSSL, every connect() fails with an unknown error while classical names such as X25519 and secp256r1 still work | Remove the ML-KEM names from the list for FIPS hosts until your OpenSSL FIPS provider is confirmed to support them, or use a provider build that does |
| set_groups() missing from the interpreter | The SSLContext object has no set_groups attribute | Upgrade to Python 3.15 or later, or guard the call so the connection uses the defaults when the attribute is absent |
| OpenSSL too old for set_groups() features | Calls fail or group() and get_groups() are unavailable on an interpreter built with an older OpenSSL | Upgrade OpenSSL to 3.2 for group() and 3.5 for get_groups(), then rebuild or reinstall Python against it |
| List leads with a hybrid group the peer cannot use | The handshake fails with "no suitable key share" on the server side, because the first key share offered matches no group the peer accepts | Reorder the list so a group the peer supports comes first, or prefix the hybrid group with ? so it is only used when the peer accepts it |
| SDK version calls set_groups() unconditionally | Connections fail after an SDK upgrade on hosts with older Python or OpenSSL, even though the code did not change | Upgrade the SDK to the release the facts name for this fix, such as splunk-sdk-python v3.0.2, or wrap the call in a try/except that falls back to a classical-only list |
| Hybrid group offered by a client with an unsupported OpenSSL | The server logs a no suitable key share rejection for an otherwise valid client | Upgrade the client OpenSSL to a version that implements the group, or restrict the server to the groups the client can use |
| Temporary workaround for any of the above | Connections must succeed now while the root cause is being fixed | Set a classical-only list such as X25519:secp256r1:X448:secp384r1:secp521r1:ffdhe2048:ffdhe3072 and plan to remove it after the upgrade is tested |
What to change in the Python code and runtime
This sequence moves the hybrid key exchange group out of a hard requirement so that Python clients stop failing when the local OpenSSL build does not support it. It ends with a client that offers hybrid groups only where the runtime can use them and falls back to a classical list until the upgrade is in place.
Mark the hybrid group with a question mark
Find every call to set_groups() in your Python code and, where the group list begins with a hybrid name such as X25519MLKEM768, add a ? prefix to that name. OpenSSL 3.3 and later ignore a group prefixed with ? when the implementation is missing, so the call no longer raises an error on an interpreter whose OpenSSL build lacks the group. Alternatively, write the list explicitly with the classical groups you accept. Restart the process after the change, then confirm that connect() succeeds against a server you already know works.
Add a fallback around set_groups
Wrap the set_groups() call in a try block and catch ssl.SSLError. In the fallback branch, apply a classical-only list such as X25519:secp256r1:X448:secp384r1:secp521r1:ffdhe2048:ffdhe3072, the list reported as a workaround in splunk-sdk-python issue 835. Log a warning whenever the fallback runs so the team can see which hosts are still using it. Treat this as a temporary measure, because it removes the hybrid group from the handshake until the runtime is upgraded. Restart the process and check the log for the warning.
Upgrade the Splunk SDK for Python
If your code uses the Splunk SDK for Python, upgrade to release v3.0.2, where the fix is reported. The reported fix is pull request 853, "Fallback for failure in setting ML-KEM SSL groups", and a comment dated 3 December 2026 says that release v3.0.2 contains it. Pin the new version in your dependency file, install it into the same environment that runs the service, and restart the process. Confirm the installed version with pip show before you test the connection.
Check the interpreter and OpenSSL build
Run ssl.OPENSSL_VERSION and ssl.OPENSSL_VERSION_INFO in the interpreter that runs your service to see which OpenSSL library it loaded. Python 3.15 adds get_groups(), which needs OpenSSL 3.5 or later, so list the groups with get_groups() to confirm that the hybrid name is present. If the version is older than your target, upgrade to a Python build linked against OpenSSL 3.5 or later. The check is complete when get_groups() includes the hybrid group you intend to offer.
Confirm the negotiated group after connecting
After a successful handshake, call SSLSocket.group() on the connected socket. It returns the group used for key agreement, or None when no connection is established, and it needs OpenSSL 3.2 or later. If the hybrid group is offered but the result is a classical group, the server may have answered after a Hello Retry Request, which the OpenSSL documentation describes for a group that is not sent in the first key share. Record the value for each server you test, and restart the process after any change to the group list.
Remove the temporary fallback
When the interpreter, OpenSSL build and SDK all support the hybrid group, remove the classical-only fallback branch and the warning. Keep the ? prefix in the group string, because it avoids a large ClientHello that may not fit in one TCP segment. Restart the process, run the connection test again against each server, and confirm that SSLSocket.group() reports the expected result. Keep the test output with your change record so the team can see the before and after state.
How the fix differs for system Python, containers and FIPS hosts
System and distribution Python packages are usually linked to a vendor-supplied OpenSSL. That OpenSSL version is set by the operating system's package manager, not by the Python version alone, so the same Python release can load different OpenSSL builds on different hosts. Before you add any group configuration, confirm which library the interpreter actually loaded.
- Read the loaded library: run
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"and compare the output withopenssl versionon the same host. They can differ. - Check for
set_groups: ifssl.SSLContexthas noset_groupsattribute, the interpreter predates Python 3.15, so use the OpenSSL-level or classical-only workaround instead. - Note the group support threshold:
SSLContext.get_groups()needs OpenSSL 3.5 or later, andSSLSocket.group()needs OpenSSL 3.2 or later. - Expect vendor patches: a distribution may backport OpenSSL changes without changing the visible version number, so ask the vendor what the packaged build supports.
Confirm the loaded OpenSSL version and the presence of set_groups on the exact interpreter your service uses before you choose a fix.
Container images inherit their OpenSSL from the base image. The version the application sees is whatever is installed in the image at build time, and a rebuild on a newer base can change it without any change to your application code. The check has to run inside the container, against the image you deploy.
- Check inside the running image: run the same
ssl.OPENSSL_VERSIONcommand in the container, usingdocker runorkubectl execagainst the deployed image tag. - Pin the base image: a floating tag can change the OpenSSL build between deployments, so record the image digest you tested.
- Keep the group list in configuration: placing the group string in an environment variable or a config file lets you change it per deployment without rebuilding.
- Test the fallback path: if one image has an older OpenSSL, the code must still start, so handle the missing method on that image.
Verify the group behavior against the exact image digest that runs in production, not against a local development interpreter.
A virtual environment isolates Python packages but not the OpenSSL library. The ssl module in a venv is still the one compiled against the interpreter's OpenSSL, so a venv built from a newer Python can still load an older system library. A pinned SDK version can also decide whether your code calls set_groups at all.
- Pin the SDK version: record the exact SDK release, since a fix may appear in a later version than the one you run.
- Confirm the interpreter source: check which Python the venv was created from with
python -c "import sys; print(sys.executable)". - Check the loaded
sslmodule path: the module location shows whether the venv uses a bundled or system build. - Do not assume the venv changes OpenSSL: rebuild or re-create the venv when you change the base interpreter, then rerun the check.
Record the SDK version and the loaded OpenSSL string together so the result can be reproduced.
On a FIPS-enabled host, the FIPS provider decides which group names it accepts, and it can reject groups that the default provider allows. A group name that works on a standard host can fail there with a generic SSL error, so a fix that passes local testing may still fail under FIPS mode.
- Expect rejected names: the splunk-sdk-python report describes FIPS-enabled Splunk 10.4.2 with Python 3.13.11 and OpenSSL 3.5.7, where the FIPS provider rejected every ML-KEM group name while accepting classical names such as X25519 and secp256r1.
- Read the error text: the message
ssl.SSLError: unknown error (_ssl.c:4981)does not name the rejected group, so test each name separately. - Test the classical fallback: the reported workaround used the classical-only list
X25519:secp256r1:X448:secp384r1:secp521r1:ffdhe2048:ffdhe3072, which you can use to confirm that the rest of the connection works. - Check the vendor release: the same report says PR 853 added a fallback and that release v3.0.2 contains the fix, so confirm which release you run.
Test on a FIPS host with the same provider configuration your production hosts use, because a result on a non-FIPS machine does not carry over.
How to confirm the Python connection works after the change
Confirm the change by rerunning the same connection test you used to reproduce the failure, from the same host and against the same server, with the same Python interpreter and ssl module. A successful result has two parts: the TLS handshake completes without an exception, and SSLSocket.group() returns the name of the group used for key agreement on that connection instead of None. Print the value after wrap_socket() or connect() returns, because group() returns None when no connection is established. Reading the group name shows which key exchange was negotiated, so you can tell a hybrid group from a classical one. Keep in mind that SSLSocket.group() needs OpenSSL 3.2 or later, so check ssl.OPENSSL_VERSION first. If the call raises an attribute error, the interpreter is linked against an older OpenSSL or an older Python, and the result does not prove anything about the hybrid group.
Treat a completed handshake as a starting point, not a finished fix. On the server side, watch for the OpenSSL message SSL routines:final_key_share:no suitable key share, which the server logs when it finds no usable client key share. That message should stop appearing for the Python client once the group list is corrected, so count it before and after the change in the same log window. Also watch the application's own error logs for ssl.SSLError entries, since a failure that only happens on some connections or some network paths will not show up in a single test. Finally, check scheduled jobs, containers and build images that install the splunk-sdk-python package or any other pinned library. A job that pins an older SDK keeps the old set_groups() behavior and can fail long after your interactive test passed, so confirm the version each job actually installs. The sources on this page do not give a fixed test duration or success rate, so decide how long to watch and what counts as enough based on your own traffic.
What can break when the Python group list changes
Changing the group list in Python affects every client and server that negotiates TLS with the process, and the effect depends on which OpenSSL build the interpreter loaded and which groups the other side accepts. The four risks below are the places where a change that works in a development environment fails in production, and each has a check to run before the change reaches a live system.
Older clients and pinned SDK versions
Older SDK releases do not call set_groups() at all, and newer releases may call it with a list that starts with ML-KEM hybrid groups that an older server or FIPS provider does not accept. The Splunk SDK for Python 3.0.0 showed the failure pattern: a hybrid-first list broke every connect() on one FIPS-enabled target. Before rollout, list each pinned SDK version in your services, confirm whether it calls set_groups(), and test the exact pinned version against every server it talks to, not only the newest one. Also check whether a fix has shipped in a later release, and record the version you will run in production.
CI runners with a different OpenSSL
The groups Python can use depend on the OpenSSL library that the interpreter loaded, and a CI runner often links a different OpenSSL than production does. ssl.OPENSSL_VERSION reports the loaded version string, and ssl.OPENSSL_VERSION_INFO reports it as a tuple of five integers. A group list that passes on a runner with OpenSSL 3.5 can fail on a host with 3.0, where set_groups() may not exist or SSLSocket.group() may not be available. Compare the output of these two attributes on the CI runner, the staging host and the production host, and run the handshake tests on the production OpenSSL version rather than the runner default.
Host-pinned algorithm lists
Some hosts and configuration files pin a group list in one place, such as a shared settings module, an environment variable or a deployment template, and every service on that host inherits it. A list that adds a post-quantum group first changes the key shares sent in every handshake from that host, which affects connections well beyond the service you meant to change. Find every location where the group string is set, including those written by configuration management, and confirm the value each process actually receives at startup. A prepended ? or * prefix can also change how the default list is ordered, so check the resolved list rather than the source text.
FIPS and compliance-mode rejection
A FIPS-enabled OpenSSL provider can reject group names that the standard build accepts, and the failure may appear only at connection time rather than when the context is configured. In the Splunk case on FIPS-enabled Splunk 10.4.2 with OpenSSL 3.5.7, the provider rejected every ML-KEM group name while still accepting classical names such as X25519 and secp256r1, and each connect() raised ssl.SSLError: unknown error. Before rollout, run the change in a FIPS-mode environment with the same provider configuration as production, and confirm which group names the approved provider accepts for your compliance scope. Ask your compliance owner whether a change to the group list needs review.
Unrecognized group names at startup
CPython raises an SSLError with the message "unrecognized group" when set_groups() fails to apply the list, so a typo or a name the linked OpenSSL does not know stops the context from being configured. Because the error appears when the context is built, a misnamed group can stop a service from starting rather than from negotiating. Validate the group string in a test that builds the context on each target OpenSSL version, and use the optional ? prefix only where a missing group should be ignored and not raise. Read the OpenSSL group format rules before writing the list, since - removes groups already added and DEFAULT selects the built-in list.
Server-side key share rejection
A server can refuse a connection when the client's key shares do not match a group the server accepts, and OpenSSL logs SSL routines:final_key_share:no suitable key share in that case. Changing the client's group order can cause this when the first key share sent is a group the server does not support and no fallback is offered. Test each Python client against the real servers it calls, read the server's error log for this message, and compare the client's offered groups with the server's configured list. Confirm the server supports the hybrid group before you assume the client is at fault.
When a Python team should get help with TLS group errors
Some TLS group errors are fixed by a few lines in your own code, but several situations call for outside help. The first is when you cannot upgrade Python or the OpenSSL library it loads. Check the version with ssl.OPENSSL_VERSION. The set_groups() method arrived in Python 3.15, SSLSocket.group() needs OpenSSL 3.2 or later, and get_groups() needs OpenSSL 3.5 or later. If your runtime is pinned to an older interpreter or a distribution-managed OpenSSL that you cannot change, the fix may depend on a release schedule outside your control, and an engineer who can plan that upgrade across your fleet is worth bringing in early.
The second situation is when you do not control the server or the vendor SDK. The Splunk case shows the risk: a SDK release that called set_groups() with hybrid ML-KEM names failed on FIPS-enabled builds, and the workarounds were a try/except wrapper or a classical-only list. If the failing call sits inside a vendor library, confirm with the vendor which SDK versions are affected and whether a fix has shipped, and ask whether the group list can be configured from outside the library. A third situation is when the same error appears across many hosts or services. Errors like final_key_share: no suitable key share on the server side can come from a load balancer or proxy rather than the client, so tracing the failing hop across the estate is a task for someone with network access and an inventory of TLS endpoints.
The last situation is a regulated environment that needs evidence of the change. Document the OpenSSL and Python versions, the group list in use, the test results before and after, and who approved the change. DeployOpen can plan and implement the change, prepare that evidence and support the testing. It does not issue audit reports or attestations. Independent auditors and certification bodies issue those, so confirm with your assessor which records they expect before the change is made.
Questions people ask about Python TLS group errors
Is the connection still encrypted when a Python TLS group error occurs?
A failed handshake does not send application data, so the connection is not established and no traffic is exchanged over it. The error means the two sides could not agree on a key exchange group, so the session never reaches the point where data flows. Whether a fallback to a classical group happens depends on what the client and server are configured to offer. Check your own traffic logs and the configuration on both ends to confirm what your environment actually does, because the sources on this page do not describe how every product handles a failed hybrid offer.
Is a Python TLS group error urgent to fix?
It is urgent when the failure breaks a production connection, because the service cannot connect until the group list is corrected. The urgency depends on what depends on that connection, not on the error text alone. A failure that appears only in a test environment is less pressing, but it should still be understood before the same code reaches production. Note that the Splunk SDK case in splunk-sdk-python issue 835 broke every connection on a FIPS-enabled system until the group list was changed, which shows how a single call can stop all traffic. Treat any failure on a live integration as a blocking issue.
Can I silence a Python TLS group error instead of fixing it?
Silencing the error is not a fix, and it should not be the approach you take. Wrapping the call in a try/except block and continuing can hide the fact that the connection is using a classical group instead of the one you intended. The splunk-sdk-python workaround that wrapped set_groups() in try/except was a stopgap, and the project later merged a fallback in PR 853. Instead, set an explicit group list that your runtime and its OpenSSL library both accept, and then confirm which group the connection actually uses with SSLSocket.group() where your version supports it.
Why does this Python TLS group error appear now?
The error appears when a Python program calls set_groups() with group names the linked OpenSSL library does not recognize, or when the client offers a hybrid group that the peer cannot process. Python 3.15, released on 9 October 2026, added SSLContext.set_groups() to the ssl module, so code that uses it will meet these checks for the first time on that version. Older interpreters without the method skip the call, which hides the problem until the code moves to a newer runtime. Check the Python and OpenSSL versions in your environment before assuming the error is new.
What should I do if I cannot upgrade the Python interpreter?
If you cannot upgrade, first confirm your OpenSSL version with ssl.OPENSSL_VERSION, since the group support you need depends on the OpenSSL library and not on Python alone. The OpenSSL 3.5 documentation says unknown groups are ignored from OpenSSL 3.3 onward when prefixed with ?, which may let an older configuration continue. Without a supported OpenSSL version, the most practical option is to set a classical-only group list that your runtime accepts, such as the list used in splunk-sdk-python issue 835. Record that change, its reason and a plan to revisit it, and test the connection after every change.
How do I check which key exchange group a Python connection is using?
Call SSLSocket.group() after the handshake to see which group the connection used for key agreement. The method returns None when no connection is established, and the Python 3.15 What's New says it needs OpenSSL 3.2 or later. To see the groups your context can use, call SSLContext.get_groups(), which the Python 3.15 documentation says needs OpenSSL 3.5 or later. You can also set SSLKEYLOGFILE to write keys to a file for debugging, though that file contains sensitive key material and should be handled and deleted with care.
When should I get outside help with a Python TLS group error?
Get outside help when the error blocks a production integration and your team cannot find the failing component within a reasonable time, or when the fix touches a FIPS-validated environment where group names must match a validated provider. Outside help is also useful when your organization must document the change for an assessment, and when several services share the same TLS configuration. DeployOpen can plan, test and document these changes inside your infrastructure as part of a fixed-scope engagement, and the scope and timelines are agreed in writing before work starts. Independent auditors, not DeployOpen, issue any audit reports or certifications.
How DeployOpen helps with Python TLS group fixes
DeployOpen works through Python TLS failures on hybrid key exchange by first confirming which OpenSSL version and Python release a team runs, then setting the allowed groups in a way that matches what the library supports. Each engagement is fixed-scope, with the scope, deliverables and timeline agreed in writing before any work starts.
How we scope
- Confirm the Python version and the OpenSSL version the interpreter loads, using ssl.OPENSSL_VERSION, before choosing a group list.
- Identify every service, script and client library that calls set_groups() or creates an SSL context, and record the peers they connect to.
- Agree in writing which connections are in scope, including any FIPS-enabled environments where the provider may reject certain group names.
How we build
- Set the group list with set_groups() using names the installed OpenSSL accepts, and add a fallback path for runtimes without the method.
- Use SSLSocket.group() and keylog output in test environments to confirm which key agreement group each connection actually negotiated.
- Test against each peer the scope covers, including servers that report no suitable key share, and record the result for each one.
How we hand over
- Deliver the final group configuration, the code changes and the test results for each connection path covered by the written scope.
- Document the OpenSSL and Python versions the configuration was verified against, so the team knows when a retest is needed.
- Walk the operations and development teams through the fallback logic and the checks they can repeat after future upgrades.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer if the team wants help after the initial handover.
- Retesting is available when the Python runtime, the OpenSSL build or a peer server changes, which is where group errors most often return.
- Confirm with your vendors and the Python and OpenSSL documentation which groups each peer accepts before changing a production list.

