07 Feb 2023 12:09 AM - last edited on 17 May 2023 02:25 PM by Michal_Gebacki
When using pyOpenSSL in a Windows ActiveGate extension, it seems not to work because pyOpenSSL seems to have a dependency on Rust. Has anyone come across it, and know the best way to get around it? Do I have to install Rust to get this working?
The errors I'm getting are like this:
ImportError: cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)
Have also tried to fix a lower version of pyOpenSSL without success...
Any ideas?
Solved! Go to Solution.
07 Feb 2023 03:02 PM
Hi - we are also getting this error so any info would be valuable - also on Windows OS
08 Feb 2023 05:06 PM
Hi,
Did you make sure that you built the plugin on a 64-bit windows machine? That should download the correct files to run it on Windows.
Mike
08 Feb 2023 08:05 PM
Yes, on a 64 bit machine, but not built in Windows, but Linux. Might be an issue?
I also tried several "install_requires" with older pyOpenSSL versions, but that didn't do the trick...
08 Feb 2023 08:07 PM
Yup, that is the problem. It always needs to be built on the same OS as it runs whenever you have native libraries.
08 Feb 2023 08:16 PM
Thanks for your quick reply! That brings up an issue that I believe I have not seen yet before in the documentation, and what are limits to cross-platform support with Dynatrace extensions. I believe this case of mine to be specific to pyOpenSSL, because it really needs the cryptographic engine, but are there other cases that we should be aware, not to make the same mistake?
And, if eventually an extension like this makes it to the Hub, how would we be able to distinguish between Linux/Windows ActiveGates?
08 Feb 2023 08:22 PM
Any extension which includes a library with a native component needs to be built on the OS where it will run. There are quite many libraries which have a native file, curious that you didn’t think run into it before.
Once you built it for Windows you can grab the OS specific files and drop it into your Linux build and then it will work for both. That is how we handle hub extensions (except that we have some automation scripts around it).
Mike
08 Feb 2023 08:30 PM
As always, I particularly value your comments 🤗 Really hadn't noticed the issue before, but well, maybe it just gives out an non-understandable error, in the few cases where I see Windows ActiveGates being used. Well, in this particular client we have several extensions still with problems, some of them from Dynatrace. Initially, there were also problems with non-9999 port being used, but now I have another clue for those...
08 Feb 2023 08:31 PM
BTW, couldn't the build process take care of this? Maybe I'll file a Product Idea later
08 Feb 2023 08:44 PM
The build process of EF2.0 Python extensions takes care of it 👍