Hi,
Thanks to everyone who helped out with the
previous problem. I've since gone ahead and started fixing all the
inconsistencies I created. However, I'm now having a more programmatic
type problem.
Using Win2K, I'm having problems with the actual
SSL_accept and SSL_connect. At the point where this happens, the sockets are
non-blocking. However, my first SSL_connect fails with error code 5
(SSL_ERROR_SYSCALL) A call to SSL_get_error() returns 0, which according to
the docco means EOF / other protocol violation. On my implementation, this
means the current object (Containing everything - including the underlying
socket) is destroyed. If I retry the connection attempt however, it works fine
and as expected.
Any suggestions / thoughts on what could be
causing this ?
--[Some
setup]--------------------------------
SSL_library_init();
SSL_load_error_strings();
m_pMethod = SSLv23_method();
m_pContext = SSL_CTX_new(m_pMethod);
// I don't specify a method, but when tracing
through the code, I see that the method is
automatically determined...
// Might be wrong here ?
// I'm going to try it with an explicit set, and
see if that makes a difference...
--[Server
side]----------------------------------
/* Some source */
int sslReturn =
SSL_accept(m_pSSL);
int nError = 0;
if(sslReturn <
0)
{
nError =
SSL_get_error(m_pSSL,sslReturn);
switch(nError)
{
--[Client side]--------------------
sslReturn =
SSL_connect(m_pSSL);
if(sslReturn >
0)
{
// Do some stuff
}
else
{
// sslReturn
== -1
nError =
SSL_get_error(m_pSSL,sslReturn);
// At this point nError == 5
int nExtraInfo =
ERR_get_error();
// nExtraInfo contains 0 - I haven't done any
processing here though
}
__________________________________________
Pascal
Qbik New Zealand
"meddle not in the affairs of dragons, for
ye are
crunchy and taste good with tomato
sauce"