New topic: 

SSLSocket with ServerSocket does not establish connection

<http://forums.realsoftware.com/viewtopic.php?t=47455>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        gm1          Post subject: SSLSocket with ServerSocket does not 
establish connectionPosted: Sun Mar 31, 2013 1:00 pm                         
Joined: Thu Apr 21, 2011 9:44 pm
Posts: 11                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/YLDW6wwY

The 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   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to