Synss / python-mbedtls

Cryptographic library with an mbed TLS back end
MIT License
79 stars 28 forks source link

Installation fails in windows with python 3.7.2 in windows env #33

Closed thiyaneshece closed 3 years ago

thiyaneshece commented 3 years ago

I am submitting a …

Description

Installation of this module fails in windows environment with python 3.7.2 When installing the module using "pip install python-mbedtls==1.3.1" in win env, i am getting below error

"WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x03DCF770>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/python-mbedtls/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) "

ERROR: Could not find a version that satisfies the requirement python-mbedtls==1.3.1 (from versions: none) ERROR: No matching distribution found for python-mbedtls==1.3.1

I think, when i see the installation" section, i came to know that this library supports for linux and macos. It would be really helpful - if the support is available for win environment,since I could not find a library that supports "PSK" cipher suites PSK-AES128-GCM-SHA256 and PSK-NULL-SHA256 for both TLS and DTLS communication.

I see that this library supports for both TLS and DTLS communication for both the ciphers that is mentioned above.

Current behavior

Getting an error when trying to install python-mbedtls module using pip command. ERROR: Could not find a version that satisfies the requirement python-mbedtls==1.3.1 (from versions: none) ERROR: No matching distribution found for python-mbedtls==1.3.1

Expected behavior

Expecting : This library shall be able to install in windows env. how to build the package or generate the wheel package in case of win env would be really helpful .

Steps to reproduce

1.use "pip install python-mbedtls==1.3.1" in python terminal in windows os.

Minimal demo of the problem

Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/python-mbedtls/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) "

Detailed log is attached for further investigation. [log_mbedtls.txt]

Other information

Windows 10 64-bit OS Python 3.7.2 pip 20.1.1

I want to clarify this doubt,however i have only option to bring this notice as an issue.

Synss commented 3 years ago

Hi @thiyaneshece,

Thank you for your feedback. You are correct that Windows is not supported.

However, mbedtls should work under Windows and I do not think that I use any *nix-specific code. With some luck, setting up AppVeyor or another Windows CI service may be sufficient. Would you have any interest in contributing? Otherwise, I will see what I can do.

Synss commented 3 years ago

Note that I consider this issue a feature request and not a bug.---Not that it makes a huge difference.

Synss commented 3 years ago

Just a short update on this issue. I have created an AppVeyor account and set up the hook to compile and test there. Now, I am also setting up an MS box locally using Vagrant and Ansible to debug a bit faster. Cheers

thiyaneshece commented 3 years ago

@Synss - Sorry that i was loaded with other activities, could not respond on time. I would say i'm a beginner in python, also i am not aware of AppVeyor setup.

Thanks for information being updated, It would really help me a lot if i get windows platform support for this library.

Synss commented 3 years ago

Hi! I have not forgotten you but I have had an IRL (small) accident and Windows is out of my confort zone (although I have interest in having this feature). I shall come back to this quickly.

Synss commented 3 years ago

Hi! Issue #36 reported missing files in the archive. That could very well be the cause for the failing installation.

Synss commented 3 years ago

Hi! I still do not have wheel for windows but could you try again with 1.4.1 and report here whether it worked? I have fixed a problem with the archive.

Synss commented 3 years ago

Hi! The lastest commit on master should let you build on Windows. You still need to install mbedtls beforehand and set the INCLUDE and LIBPATH variables if mbedtls is not in the expected locations.

I have had success compiling mbedtls from git in the current 2.16 branch with the following call: MSBuild.exe /NoLogo /MaxCpuCount /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v140 /p:WholeProgramOptimization=False .\visualc\VS2010\mbedTLS.sln from the mbedtls root (say, $env:MBEDTLSROOT).

And then, from the python-mbedtls root, you need to set INCLUDE to the include directory from mbedtls (e.g.: $env:MBEDTLSROOT\include) and LIBPATH to something like $env:MBEDTLSROOT\visualc\VS2010\x64\Release and python setup.py install should work.

Note that I run everything under PowerShell and from the "x64 Native Tools Command Prompt for VS 2019". I am not sure whether this is a requirement or not.

This is still a bit involved and I will keep working on making wheels for Windows. That should be easier now.