-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
requests.exceptions.SSLError: HTTPSConnectionPool(host='our-domain', port=443): Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) #1548
Comments
Are you using a pre-compiled cx_Freeze (binary from pypi, v6.11.1 for instance) ou 6.12 development version or are you compiling by sources? |
Hello @marcelotduarte, thanks for maintaining this awesome tool! I have tried Pyinstaller but I feel that it is not straight forward as cx_Freeze and it gets quickly complicated when dealing with many deps, where cx_Freeze makes it way easier (and it feels lighter and faster IMO). I'm about to finish up a PoC for my open-source project. I have some Python files that use the
Here is about my env:
Here is how to reproduce the error in a simple way:
import requests
try:
r = requests.get('https://jsonplaceholder.typicode.com/todos/1')
print(r.json())
except requests.exceptions.RequestException as e:
print(e)
pipenv --three
pipenv install requests
pipenv install --dev cx_Freeze
pipenv --venv
~/.local/share/virtualenvs/Workspace-C02APTuR/bin/cxfreeze --compress test.py
./build/exe.macosx-12.4-x86_64-3.9/test The error appears on that level. Extra InfoWhereas when I run it directly from my virtual env, it works correctly: pipenv run python test.py
# Result
{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False} Also, when I run the following to see if the SSL module is found in the virtual env, it returns the version without any error: pipenv run python -c "import ssl; print(ssl.OPENSSL_VERSION)"
# Result
OpenSSL 3.0.5 5 Jul 2022 I also tried to install from a development build by installing in this way: pipenv install ./cx_Freeze-6.12.0.dev1-cp39-cp39-macosx_10_9_x86_64.whl But the result is the same. By trying with the Please let me know if you need further information, I will be happy to provide! |
It seems to be working when using I'm not sure what breaks it from the changelog, can anyone help to point this out? |
Earlier I asked:
My assumption was that the PR #1505 is breaking something:
Try using: |
Yes it seems to make the job. I'm using Pipenv, so I'm doing the following command to install packages from the Pipfile: PIP_NO_BINARY=cx_Freeze pipenv install |
cx_Freeze 6.12.0 has just been released. |
This works for me just fine if I downgrade to But
However, if I use |
@louistiti @adamcharnock Can you test using certifi?
A second test is:
Does it fail?
Does it work? |
Sorry for the slow reply. I've just come back to this because it has stopped working again. I'm digging into this now, but to answer your questions, all three produce errors. The three errors (respectively) are:
Also running a test for a simple
Which seems like a clue. Also, FYI:
Will continue looking into this momentarily. |
Right, so this file doesn't exist
But that files does exist here:
In fact, there are a few dylib files in there: So I'm guessing the build process isn't putting the |
Ok, I've put in place a bit of a hack in the build process to just see if I can get to a solution. I just move all the for dylib_file in build_directory.glob("*.dylib"):
dylib_file.rename(dylib_file.parent / "lib" / dylib_file.name) Which seems to help. Tests 3 and 4 (test 4 is
So, progress. Update: It actually seems to work now. In test one, changing this: r = requests.get('https://jsonplaceholder.typicode.com/todos/1', cert=certifi.where()) to this:
resulted in test 1 now working. I guess requests knows where to find its own certs. |
Same problem here (MacOS 13.1, cx_Freeze 6.13.1 installed via pip). @adamcharnock's hack works for me too, and since it took me a while to figure out how to actually put it in place 😅 (I have zero experience with setuptools), I thought it worth adding it here: from pathlib import Path
from cx_Freeze import setup, build_exe
class DyLibFixerCommand(build_exe):
def run(self):
super().run()
for dylib_file in Path(self.build_exe).glob("*.dylib"):
dylib_file.rename(dylib_file.parent / "lib" / dylib_file.name)
COMMAND_CLASS = {"build_exe": DyLibFixerCommand}
setup(
... # Your configuration here
cmdclass=COMMAND_CLASS,
) |
Sorry for the delay in looking at this. I don't work with Mac, and usually, a contributor looked at this part, but he migrated to Windows. You can test the patch in the latest development build: |
Ah, thanks, but unfortunately I don't work on that project anymore, and I don't have access to the source code. Thanks anyway, and I completely understand the delay! 🙇🏻 |
Release 6.15.3 is out! |
Hello, we where able to compile the app with cx_freeze successfully and it opens also on all test devices. However, as soon as we try to activate the license, we receive this error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='our-domain', port=443): Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
That's our setup.py, any idea what we can try to solve this?
It's also weird that it works on my local device after compiling, and on some test devices. But most of the time the test users receive the SSL Error.
The text was updated successfully, but these errors were encountered: