In SSLeay you could use SSLv23_method() to get a method that could later be used for either connect or accept. For example, Tim's apps do that. But that doesn't work in openssl. SSLv23_method() initializes both method->ssl_connect and method->ssl_accept. But when method->ssl_accept is defined that causes SSL_new() to set s->server, which causes SSL_clear() to set s->state=SSL_ST_BEFORE|SSL_ST_ACCEPT instead of SSL_ST_BEFORE|SSL_ST_CONNECT, which causes ssl23_connect() to fail because of an unknown state. True, the app could use SSLv23_client_method()/SSLv23_server_method() instead, or it could call SSL_set_connect_state() before connecting the way s_client does. Seems like it would be easier to just get rid of the s->server variable and set s->state=SSL_ST_BEFORE until the app connects or accepts, then have the connect or accept routine add the SSL_ST_ACCEPT or SSL_ST_CONNECT bit. That's the way sockets work, right? ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
