Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsa.lua:149: cannot resolve symbol 'RSA_new' #23

Open
sstong123 opened this issue Apr 24, 2018 · 4 comments
Open

rsa.lua:149: cannot resolve symbol 'RSA_new' #23

sstong123 opened this issue Apr 24, 2018 · 4 comments

Comments

@sstong123
Copy link

When I do as your example in README.md,I got the error as below:

2018/04/24 19:57:26 [error] 125048#124724: *47909566 lua entry thread aborted: runtime error: ...y_For_Windows_1.13.5.1001_64Bit\x64\nginx//resty\rsa.lua:149: cannot resolve symbol 'RSA_new': 找不到指定的程序。

stack traceback:
coroutine 0:
[C]: in function '__index'
...y_For_Windows_1.13.5.1001_64Bit\x64\nginx//resty\rsa.lua:149: in function 'generate_rsa_keys'

@spacewander
Copy link
Owner

@sstong123
OpenSSL symbols are not exported by default in the Windows.
I don't have a Windows environment to test, but you may solve this problem by adding these lines under local C = ffi.C:

-- you need to have ssleay.dll in your system library path
if ffi.os == 'Windows' then
    C = ffi.load("ssleay.dll")
end

@spacewander
Copy link
Owner

Another solution is to use gcc from msys2 to build your OpenResty suite, including the OpenSSL library.
gcc will export all symbols by default unless -fvisibility=hidden is specified. I guess its behavior is consistent under Windows.

@sstong123
Copy link
Author

sstong123 commented May 2, 2018

@spacewander My Openresty_For_Windows 64bit is work well, and some other third librarys works fine when I put them under nginx\resty, can you please describe it in detail how shoud I do?
Also, can you make the rsa library compatible with Openresty_For_Windows?If need I can post request under Pull requests.

@spacewander
Copy link
Owner

@sstong123
The problem is that I don't have a Windows to test for. BTW, will you try the official windows release? https://github.com/openresty/openresty/blob/master/doc/README-windows.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants