Fails to import dlls which can't use TLS
Specifically, cryptography.hazmat.bindings._rust.pyd does not allow for TLS, but pythonmemorymodule forces use of TLS, not sure what the solution would be here, but it isn't compatible.
Hi, I was able to load _rust.pyd calling PyInit__rust using PythonMemoryModule.
The pyd has a TLS callback and it looks like it's correctly executed:
Can you elaborate on the issue you are facing?
I'm using python 3.11 and the pyd you get when you pip install OpenSSL with dependencies
I'll try to get a screenshot when I get back to my desk
This is what I'm seeing when I try to do the dll = pythonmemorymodule.MemoryModule(data=buf debug=True)
I've also tried importing it directly with _memimporter and it throws a different error
This one led me to do some searching and it appeared as though _rust wasn't meant to support TLS.
I was able to load _rust.pyd using Python 3.10.8 and pythonmemorymodule_wininet in the Pyramid dev branch. Give it a try and let me know if that goes through also for you
I downloaded the pythonmemorymodule_wininet.zip file, extracted it and then imported it and tried again on python3.10.11 and still get the same error.
I confirm that with version 3.10.10 and 3.10.8 you can successfully load the _rust.pyd contained in this archive
I don't know the nuances of _rust.pyd files compiled for other python versions. I usually stick with versions 3.10.x because that's what I tested the most.
How did you obtain that version of _rust.pyd?
it's a freezed dependency for paramiko from late 2022. Check the about.py file, It's the cryptography package version 37.0.4, you can download it directly from PyPi.
Awesome, I'll take a look at that and give it a try
How about this? DD.zip
DEBUG: execute 0
DEBUG: read 1
DEBUG: write 0
DEBUG: physaddr:0x826f000
DEBUG: Executing TLS.
DEBUG: no TLS address found
DEBUG: Starting new thread to execute PE
DEBUG: Checking for entry point.
DEBUG: Calling dll entrypoint 0x819588c with DLL_PROCESS_ATTACH
Then the script terminated.
Could you tell me if there exists any workaround? Thanks!