Comments (3)
"unknown protocol version" is not an Indy error message. Offhand, it sounds more like an OpenSSL error message. Which version of OpenSSL are you trying to use, exactly? And did you verify that the correct version is actually being loaded correctly in the FPC+Linux scenario that doesn't work?
The only difference between Indy's Linux support in Delphi vs Lazarus should be the underlying socket API begin used (see the TIdStackVCLPosix
class for Delphi and the TIdStackLibc
/TIdStackUnix
classes for FPC), which has nothing to do with how Indy uses OpenSSL. Other than the socket APIs, most things in Indy should be nearly identical in both compilers.
What you have provided is a lot of code to go through, and I have no way to test/debug it, as I don't have Linux or FPC environments available.
However, one issue I do see in your code is that you are opening the TLS and non-TLS TCP servers on different listening ports, but your TCP client is only connecting to the non-TLS port even if TLS is being used. So, that alone can cause OpenSSL errors if a non-TLS client connects to a TLS server, or vice versa.
from indy.
Hello Remy,
I see that the example was too convoluted so here is a new refined version. It is much more simpler than before but has the same problems with Lazarus under Linux. You almost definitely wont be able to locate an error without Lazarus on Linux, it's very specific. It has nothing to do with SSL (I could not get to test it yet) so I totally removed it. other unnecessary features were removed too. The test program emulates a simple HTTP server and is very simple to use: start any server - send a packet - receive the result - show it. As I said before it works fine on Delphi+Windows, Delphi+Linux and Lazarus+Windows, The only unworkable solution is under Lazarus+Linux.
Ravil
HTTPDemoRefined.zip
from indy.
I see that the example was too convoluted so here is a new refined version. It is much more simpler than before but has the same problems with Lazarus under Linux.
And, what are the problems EXACTLY? All you mentioned earlier was "unknown protocol version", but that shouldn't be a factor anymore since you removed SSL/TLS from the test. Initially, you said "fails due to various reasons", but you didn't say what they actually were.
You almost definitely wont be able to locate an error without Lazarus on Linux, it's very specific.
Since I don't have a Lazarus+Linux setup, you will have to debug it for me, and then I can post a fix once the underlying cause has been identified.
The test program emulates a simple HTTP server and is very simple to use: start any server - send a packet - receive the result - show it.
Some logic issues I see, but which shouldn't cause platform-related issues:
-
THttpServer.TCPServerExecute()
is not sending a valid HTTP response (no status line), and also is sending a trailing CRLF after theHTML_TEXT
which is not included in theContent-Length
header, soTHttpServer.SendTCPCommand()
doesn't read the CRLF. Not that it matters in this test, sinceSendTCPCommand()
disconnects after the response, but it would be a communication mismatch for clients that don't disconnect. -
in
THttpServer.SendTCPCommand()
, you don't need theTMemoryStream
to receive the server's UTF-8 response, you could use Indy'sTIdIOHandler.ReadString()
method instead, which has parameters for byte count, byte encoding, and string encoding. -
UDP does not guarantee packets arrive in the same order they are sent. So, in
THttpServer.SendUDPCommand()
, rather than having the UDP server send 2 separate packets for its response, you should have it send only 1 packet. There is no need to send a packet that just contains the length of the next packet, that is redundant. Either put the content length in the same packet as the content, or just omit the content length altogether since the packet size can serve the same purpose.
As I said before it works fine on Delphi+Windows, Delphi+Linux and Lazarus+Windows, The only unworkable solution is under Lazarus+Linux.
And, what exactly IS NOT WORKING in the Lazarus+Linux scenario that DOES work in the other scenarios? Please be more specific.
from indy.
Related Issues (20)
- Error reading IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method: Invalid property value HOT 2
- Make it easier to send replies in TIdEventSocksServer event handlers
- EIdOpenSSLShutdownError on TCP server shutdown after verifying SSL_shutdown result code HOT 4
- When SSL_get_error() returns SSL_ERROR_SYSCALL, include the error from GetLastError()
- documentation can't be downloaded HOT 5
- Assume the highest supported compiler version when a new compiler is released
- CTCP PING does not return correct value HOT 6
- Update IdCustomHTTPServer responses HOT 1
- SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) + SCRAM-SHA3-512(-PLUS) supports
- Delphi 2007 w/ Indy 10.6.2.0 Won't Compile (File not found: IdSys.dcu) HOT 2
- EConvertError in TIdX509.notBefore and TIdX509.notAfter properties for 4-digit years
- Tidtelnet.Disconnect cannot be disconnected HOT 2
- No FHeadIndex - A Bug? HOT 4
- Wont Reset Bytes - A Bug? HOT 4
- Rad Studio 12 - Settings compatible HOT 3
- idHttp - IPv6 - IPVersion-ProtocolSwitch on Redirect (HandleRedirects=true) HOT 1
- IdSSLOpenSSL - UTC_Time_Decode - convert to char should be PAnsiChar instead of PChar on Unicode - Solved HOT 1
- Delphi Athena + Indy10 + Ubuntu 22.04.4 HOT 4
- Unable to build for C++ Builder 5 HOT 16
- how to install indy10 on the latest version of Delphi? HOT 2
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 indy.