曾試過用VS2005編譯各種版本openssl都會到最后用perl測試說LOADDLL失敗,不得其解,可是用下面的方法即可安裝成功,考慮是不是人家是用VC6編譯的:
更新于08年11月7日:
下面的PPM用不了了,參看這個:http://theoryx5.uwinnipeg.ca/ppms/
C:\Documents and Settings\Administrator>ppm install http://theoryx5.uwinnipeg.ca/ppms/Net_SSLeay.pm.ppd
或者
add this repository to your list (perl 5.8):
ppm> rep add RKOBES http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
then search:
ppm> search SSLeay
Searching in Active Repositories
1. Crypt-SSLeay [0.51] OpenSSL glue that provides LWP https support
2. Crypt-SSLeay [0.51]
3. Net_SSLeay.pm [1.25] Perl extension for using OpenSSL
ppm>install Net_SSLeay.pm
在解壓目錄下,運行perl test.pl可以成功。
這是在perlorg上問的貼,可以參考:
http://perlchina.sun126.com/cgi-bin/ccb/topic_view.cgi?forum=4&article_id=0004061125003921&publishtime_id=0004061125003921&page=40
更新于2008年1月6日:
最近,又再次試圖自己安裝OPENSSL+SSLeay,用了SSLeay里README.WIN32說的方法:
3. Windows XP SP2 CAUTION: this is not working yet
ActivePerl 5.8.8.820
Visual Studio Express 2005
Microsoft Platform SDK SVR2003R2
OpenSSL 0.9.8e source openssl-0.9.8e.tar.gz
Dynamic linking to SSL DLLs
- Install all packages in the order listed above (make sure you follow the
instructions on the download page about adding the appropriate paths to the
Projects and Solutions section of the Options dialog box, and updating
corewin_express.vsprops file)
- Start a build shell with Start->All Programs->Microsoft Windows SDK->CMD Shell
- cd openssl-0.9.8e
- perl Configure VC-WIN32 --prefix=c:/OpenSSL
- ms\do_masm
- nmake -f ms\ntdll.mak
- nmake -f ms\ntdll.mak install
(if you have trouble getting to this stage, consult INSTALL.W32)
- cd Net-SSLeay-xxxx
- perl Makefile.PL
- nmake
- copy c:\OpenSSL\bin\*.dll blib\arch\auto\Net\SSLeay\
- nmake test
CAUTION: nmake test fails at this stage. Any suggestions?? This may be
relevant: http://www.itwriting.com/blog/?postid=261&replyto=2542
- nmake install
應該說基本成功了,這次也最后同樣遇到了LOADDLL失敗,好像是R2604錯誤,這是引用msvcr80.dll出的問題,順著方法里提到的URL看一下這里,介紹了微軟為了解決DLL HELL問題引入了SIDE BY SIDE的DLL存在方式,我把我看了這篇文章的理解說明如下:
微軟現在使用MANIFEST資源文件注入到DLL中的方法來解決DLL的依賴問題,在這個文件中以XML方式說明了本DLL將會引用到的其它系統DLL的詳盡版本,這個文件由鏈接器自動生成。其機關在此:
可以到C:\WINDOWS\WinSxS看一下,這里共存了相同名字不同版本的DLL。
特別是POLICIES目錄中MSVCR80目錄中相關XML有一句:
<bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.762"/>
這就是說凡是有DLL中引用了之前老版本都會被重定位到最新版本。
VC2005編譯出來的SSLeay.dll引用的是8.0.50608.0的,我們要把鏈接器產生的MANIFEST文件注入到DLL中:
mt /manifest SSLeay.dll.manifest /outputresource:SSLeay.dll;#2
這樣至少可以通過NETSSLEAY的自測了。
但是,凡事都有個但是,真FAINT,當我用IO::Socket::SSL包時,報找不到randomize函數,是不是因為SSLeay太新了的緣故,此事還無解。所以為了用這個包,還是用前述的PPM方式安裝會比較好,那個方法我已經驗證過,裝和用都沒問題。
posted on 2006-11-26 11:35
我愛佳娃 閱讀(2321)
評論(0) 編輯 收藏 所屬分類:
Perl