{"id":9630,"date":"2026-05-10T23:30:35","date_gmt":"2026-05-10T23:30:35","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=9630"},"modified":"2026-05-10T23:30:36","modified_gmt":"2026-05-10T23:30:36","slug":"python-ssl-sslerror-ssl-library_has_no_ciphers-library-has-no-ciphers-_ssl-c3135","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/python-ssl-sslerror-ssl-library_has_no_ciphers-library-has-no-ciphers-_ssl-c3135","title":{"rendered":"Python &#8211; ssl.SSLError: [SSL: LIBRARY_HAS_NO_CIPHERS] library has no ciphers (_ssl.c:3135)"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\">python3 -m pip install pdfplumber pymupdf openpyxl pillow requests --trusted-host pypi.org --trusted-host files.pythonhosted.org\nDefaulting to user installation because normal site-packages is not writeable\nWARNING: There was an error checking the latest version of pip.\nERROR: Exception:\nTraceback (most recent call last):\n  File \"Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\base_command.py\", line 107, in _run_wrapper\n    status = _inner_run()\n  File \"Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\base_command.py\", line 98, in _inner_run\n    return self.run(options, args)\n           ~~~~~~~~^^^^^^^^^^^^^^^\n  File \"\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\req_command.py\", line 96, in wrapper\n    return func(self, options, args)\n  File \"\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\commands\\install.py\", line 340, in run\n    session = self.get_default_session(options)\n  File \"C:\\Users\\pwell\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\index_command.py\", line 82, in get_default_session\n    self._session = self.enter_context(self._build_session(options))\n                                       ~~~~~~~~~~~~~~~~~~~^^^^^^^^^\n  File \"\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\index_command.py\", line 101, in _build_session\n    ssl_context = _create_truststore_ssl_context()\n  File \"\\Packages\\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python313\\site-packages\\pip\\_internal\\cli\\index_command.py\", line 51, in _create_truststore_ssl_context\n    ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n  File \"C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.13_3.13.3568.0_x64__qbz5n2kfra8p0\\Lib\\ssl.py\", line 438, in __new__\n    self = _SSLContext.__new__(cls, protocol)\nssl.SSLError: [SSL: LIBRARY_HAS_NO_CIPHERS] library has no ciphers (_ssl.c:3135)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What\u2019s wrong<\/h2>\n\n\n\n<p>The failure is&nbsp;not&nbsp;pip or your packages.&nbsp;<code class=\"\">ssl<\/code>&nbsp;is broken before any download: creating a TLS context raises&nbsp;<code class=\"\">SSL: LIBRARY_HAS_NO_CIPHERS<\/code>.<\/p>\n\n\n\n<p>We confirmed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Without any change,\u00a0<code class=\"\">ssl.create_default_context()<\/code>\u00a0fails the same way pip does.<\/li>\n\n\n\n<li>With\u00a0<code class=\"\">OPENSSL_CONF=NUL<\/code>,\u00a0<code class=\"\">ssl.create_default_context()<\/code>\u00a0succeeds\u00a0and\u00a0<code class=\"\">pip install<\/code>\u00a0completes\u00a0(your packages installed successfully in this environment).<\/li>\n<\/ul>\n\n\n\n<p>So OpenSSL is reading a&nbsp;system config that leaves you with no usable TLS ciphers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Likely root cause (system&nbsp;<code>openssl.cnf<\/code>)<\/h2>\n\n\n\n<p>Under&nbsp;<code>C:\\Program Files\\Common Files\\SSL\\openssl.cnf<\/code>, the OpenSSL 3&nbsp;provider&nbsp;section turns on&nbsp;legacy&nbsp;but does&nbsp;not&nbsp;activate the&nbsp;default&nbsp;provider:<\/p>\n\n\n\n<p>[default_sect]<\/p>\n\n\n\n<p># activate = 1<\/p>\n\n\n\n<p>[legacy_sect]<\/p>\n\n\n\n<p>activate = 1<\/p>\n\n\n\n<p>OpenSSL\u2019s own comments in that file say that if you explicitly activate other providers, you usually must&nbsp;also&nbsp;activate the&nbsp;default&nbsp;provider, or things break. That matches \u201clibrary has no ciphers\u201d for normal TLS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What you can do<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Quick workaround (no admin)<\/h3>\n\n\n\n<p>In&nbsp;PowerShell&nbsp;for that session:<\/p>\n\n\n\n<p>$env:OPENSSL_CONF = &#8216;NUL&#8217;<\/p>\n\n\n\n<p>python3 -m pip install &#8230;<\/p>\n\n\n\n<p>Or one line:<\/p>\n\n\n\n<p>$env:OPENSSL_CONF=&#8217;NUL&#8217;; python3 -m pip install pdfplumber pymupdf openpyxl pillow requests<\/p>\n\n\n\n<p>To make it permanent for your user:&nbsp;System Properties ? Environment Variables ? User&nbsp;? add&nbsp;<code class=\"\">OPENSSL_CONF<\/code>&nbsp;=&nbsp;<code class=\"\">NUL<\/code>. (Some other OpenSSL-based tools will also skip the broken global config.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Proper fix (needs Administrator)<\/h3>\n\n\n\n<p>Edit&nbsp;<code>C:\\Program Files\\Common Files\\SSL\\openssl.cnf<\/code>, in&nbsp;<code class=\"\">[default_sect]<\/code>,&nbsp;uncomment&nbsp;so the default provider is activated:<\/p>\n\n\n\n<p>[default_sect]<\/p>\n\n\n\n<p>activate = 1<\/p>\n\n\n\n<p>Save (elevated\/editor as admin). After that you can drop&nbsp;<code class=\"\">OPENSSL_CONF=NUL<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What\u2019s wrong The failure is&nbsp;not&nbsp;pip or your packages.&nbsp;ssl&nbsp;is broken before any download: creating a TLS context raises&nbsp;SSL: LIBRARY_HAS_NO_CIPHERS. We confirmed: So OpenSSL is reading a&nbsp;system config that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9630","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=9630"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9630\/revisions"}],"predecessor-version":[{"id":9631,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9630\/revisions\/9631"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=9630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=9630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=9630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}