Hi all
I built a very simple server and client to collect data from some sites (client side), include in JSON stream and send to a server side, both as console application.
Using SSLSocket with Secure = False works good, no problems at all. But, when Secure is enabled no connection is made on the server side. The client is running on Linux and the server on Mac.
I also tested building a certificate file, with the following commands:
ssh-keygen -t rsa
openssl req -new -key collector.key -out collector.csr
openssl x509 -req -days 365 -in collector.csr -signkey collector.key -out collector.crt
The key and crt file was concat'd, but the result is the same.
Using tshark on the client side:
http://pastebin.com/YLDW6wwYThe code on the server side is:
Server side, ServerSocket AddSocket:
Dim Ret as Class_SecureTCP = New Class_SecureTCP
dim f as FolderItem
if DebugBuild Then
f = GetFolderItem("").Parent.Child("collector.crt")
else
f = GetFolderItem("").Child("collector.crt")
end if
SocketIndex = SocketIndex + 1
Ret.SocketId = socketIndex
ret.CertificateFile = f
ret.Secure = True
return Ret
Client side:
st = new Class_SecureTCP
dim f as FolderItem
if DebugBuild Then
f = GetFolderItem("").Parent.Child("collector.crt")
else
f = GetFolderItem("").Child("collector.crt")
end if
st.Address = mainConfig.Value("remoteip")
st.Port = mainConfig.Value("remoteport")
st.CertificateFile = f
st.Secure = True
st.Connect
tout = Ticks() + 600
do until st.IsConnected
tact = Ticks()
if tact > tout Then
exit do
end if
App.DoEvents(10)
loop
if not st.IsConnected Then
clog(CurrentMethodName, "Unable to connect to remote socket")
exit sub
end if
st.Write(coll.ToString)
st.Flush
What am I doing wrong?
Thanks in advance,
Gustavo