simple ftputil ssl client

C

Croteam

Hello,

I trying to make ftputil client that uses ssl security.First I was try
to make that with M2Crypto,but
when I use it, I get the error:

Traceback (most recent call last):
File "<pyshell#32>", line 1, in -toplevel-
import M2Crypto
File "C:\Python24\lib\site-packages\M2Crypto\__init__.py", line 15,
in -toplevel-
import m2
File "C:\Python24\Lib\site-packages\M2Crypto\m2.py", line 28, in
-toplevel-
from __m2crypto import *
ImportError: DLL load failed with error code 182

....so now I trying to make it with pyOpenSSL or twistedmatrix ssl,but I
don't know how.If anybody
have any idea or example how to I make it,please help me!!!
 
S

Stefan Schwarzer

I trying to make ftputil client that uses ssl security.First I was try
to make that with M2Crypto,but
when I use it, I get the error:

Traceback (most recent call last):
File "<pyshell#32>", line 1, in -toplevel-
import M2Crypto
File "C:\Python24\lib\site-packages\M2Crypto\__init__.py", line 15,
in -toplevel-
import m2
File "C:\Python24\Lib\site-packages\M2Crypto\m2.py", line 28, in
-toplevel-
from __m2crypto import *
ImportError: DLL load failed with error code 182

It seems this problem has nothing to do with ftputil, so it might
be best to post the question on the failed import alone with a
subject like

ImportError for M2Crypto: "DLL load failed with error code 182"

or even, since a Google search implies the problem doesn't occur
only for M2Crypto,

ImportError: "DLL load failed with error code 182"

With the current subject, people may think "I don't know ftputil"
and don't read your posting at all.

You might ask the question with the above subject on the
Python-Crypto mailing list which seems to be the best place for
M2Crypto-related questions. You should tell the version of
M2Crypto and the operating system you use. By the way, have you
tried other M2Crypto versions?

Can you import the module when the current directory is the one
containing the DLL? To check, change to the directory and start
the interactive Python interpreter. (If you use an IDE or
something similar, as your traceback suggests, that program might
change the directory before the import statement runs.)
Additionally, you can try to modify sys.path to contain the path
of the DLL before invoking the import statement. See also my
response on the ftputil mailing list.
...so now I trying to make it with pyOpenSSL or twistedmatrix ssl,but I
don't know how.If anybody
have any idea or example how to I make it,please help me!!!

Now the part specific to ftputil ;-) ...

If you can't use M2Crypto, try to make sure that you have a class
which is compatible with ftplib.FTP. You can pass such a class as
session_factory to ftputil.FTPHost's constructor. If you don't
have such a class, you might be able to write it yourself.

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top