Re: [twsocket] SslWSocketServer

2015-04-03 Thread Tony Caduto
Why don't you store it as a resource and use a resource stream?
On Apr 3, 2015 7:50 AM, COX Geoff g...@cilasoft.com wrote:

 Hello,

 I am having a couple of issues with trying to use a SSL connection.
 The scenario:
 My app is a TCP/IP server which can use (or not) an SSL connction. For
 this I have modified the demo example TSimpleSslServerForm available on
 the ICSD website.
 I have a couple of issues:
 First Issue
 I have generated a certificate authority certificate, a server certificate
 and a private key using OpenSSL. My app works (in as much as it receives
 the SSL message) correctly., by setting the appropriate SslContext1
 properties to the relevant files.
 But, the server private key, must be present as a file on the local PC
 running the application. This means that the private key is anything but.
 A crude fix for this has been to create the file holding the key when the
 application starts and then delete the file when the app closes, but this
 is far from ideal. My question is, is there an  way I can pass the private
 key to the SslContext1 component as a string or other structure so that the
 private key can be compiled inside the application and thus remain private?

 Second Issue
 When I try to connect to the server application sequentially with multiple
 records, the first connection functions, (issuer is Trusted, Message is
 received), but subsequent attempts to connect fail with error code 10053
 Any idea what this signifies and how I can go about getting the app to
 work properly?

 Thanks,
 Geoff Cox
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] SslWSocketServer

2015-04-03 Thread Angus Robertson - Magenta Systems Ltd
 But, the server private key, must be present as a file on the local 
 PC running the application. This means that the private key is 
 anything but.

Currently, SslContext only reads keys and certificates from files, not streams
or anything else.  That was how I added DHParams last month, but in retrospect
these (up to four of different key lengths) would be better loaded as streams.
So I'll look at loading all files as streams, but it may be a few weeks. 

 subsequent attempts to connect fail with error code 10053

You can convert winsock error numbers to messages with
WSocketGetErrorMsgFromErrorCode, it will tell you aborted which does not mean
much.  You have probably not closed the previous connection.

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] SslWSocketServer

2015-04-03 Thread COX Geoff
The error occurs even though the socket has been closed.

The client does the following
1. Creates the socket
2. Connects to socket (I get connected message )
3. SSL Handshake
4. Writes to socket
5. Closes socket

The second time I try, I get the Client Disconnected when the SSL Handshake 
is attempted.

Output of App:

Listening - TCP/IP SSL...
Connected :  Remote: 192.168.5.94/17279 Local: 192.168.5.126/992
Issuer is Trusted
192.168.5.94 Message == 
MESSAGE
Client disconnected.0
---
Connected :  Remote: 192.168.5.94/13527 Local: 192.168.5.126/992 == second 
connection
Client disconnected.10053   == when SSL Handshake is invoked from client
---



-Original Message-
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus 
Robertson - Magenta Systems Ltd
Sent: vendredi 3 avril 2015 15:04
To: twsocket@lists.elists.org
Subject: Re: [twsocket] SslWSocketServer

 But, the server private key, must be present as a file on the local PC 
 running the application. This means that the private key is anything 
 but.

Currently, SslContext only reads keys and certificates from files, not streams 
or anything else.  That was how I added DHParams last month, but in retrospect 
these (up to four of different key lengths) would be better loaded as streams.
So I'll look at loading all files as streams, but it may be a few weeks. 

 subsequent attempts to connect fail with error code 10053

You can convert winsock error numbers to messages with 
WSocketGetErrorMsgFromErrorCode, it will tell you aborted which does not mean 
much.  You have probably not closed the previous connection.

Angus

--
To unsubscribe or change your settings for TWSocket mailing list please goto 
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be