Comments (7)
Could you tell me the parameters of SSL_set_fd() on win64? (ssl.h)
I think we have another problem...
from luasec.
I think so, but not very urgent.
Same as in win32: SSL_set_fd(SSL *s, int fd) but int is 64-bit.
I think that normal fd fits into lua number, but invalidfd in win64 not.
I have two ideas how to fix it:
- clean solution - reimplement fd as light userdata
- fast dirty - remove invalidfd constant and add two methods isvalidfd and invalidatefd
from luasec.
Sorry, but I think "int" is not 64 bits on win64.
from luasec.
You are right, my mistake - int is 32bit
But in win64 SOCKET and INVALID_SOCKET size is 64bit (UINT_PTR)
from luasec.
I temporary solve the problem this way:
--- a/src/ssl.lua
+++ b/src/ssl.lua
@@ -126,7 +126,8 @@ function wrap(sock, cfg)
local s, msg = core.create(ctx)
if s then
core.setfd(s, sock:getfd())
-
sock:setfd(core.invalidfd)
-
--sock:setfd(core.invalidfd)
-
registry[s] = ctx
sock:setfd(-1)
return s
end
Works for me in linux32/64 and win32/64, lua 5.1 and 5.2
from luasec.
It seems that LuaSocket transforms -1 into INVALID_SOCKET.
Other libraries, like luaevent, use the descriptor directly. Luckily (or not), when we cast (-1) to uint32 or uint64 we have UINT32_MAX (UINT64_MAX), that is INVALID_SOCKET on win32/64.
from luasec.
Note: if Windows returns big numbers for socket, we still have problem due to double representation. Integer numbers of Lua 5.3 can help us...
from luasec.
Related Issues (20)
- LuaSocket get-/setoption methods HOT 3
- ssl.https.request dont work HOT 6
- Off by one in `cert:validat(notafter)` HOT 2
- [HTTPS] Problems with memory consumption when loading the CA certificate HOT 5
- skip response headers messages HOT 2
- SSL Handshake fails without an error message HOT 2
- Compilation fails with >=openssl-3.0.0 HOT 1
- Can't compile source code in luasec.vcxproj HOT 1
- method `conn:shutdown()` is missing HOT 4
- Is openssl 1.0.2 supported with lua 5.1 release? HOT 2
- Docker container crashed when lua calling ssl.so library HOT 4
- Android shared library
- Sumneko's Lua language server shows a warning for passing 2 variables to a function with only 1 argument in https.lua HOT 1
- New release HOT 4
- Failed to install with mingw64 HOT 6
- Installation on an embedded Lua v5.1 (with no Lua Rocks) HOT 12
- tls-psk regress after #194 HOT 3
- Failed VS2022 BUILD | openssl-3.2.0 and crypt32.lib
- Emerged on Gentoo version 1.3.2, and I see it by path /usr/share/lua/5.1/ssl/https.lua, but expected for version 5.4
- Does this library support DTLS? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luasec.