Hi all, I'm working on a multi-clients server under Windows2k. My problem is about file descriptor / socket confusion when creating a BIO.
In fact main code's jobe is to accept the socket in an "int" variable, then CreateProcess(). This function is called with newly accepted socket as argument, in place of file descriptor number 0 (input). ctrl = accept(); si.hStdInput = ctrl; si.hStdOutput = INVALID_HANDLE_VALUE; si.hStdError = INVALID_HANDLE_VALUE; si.dwFlags = STARTF_USESTDHANDLES; CreateProcess(..., &si); New process will inherit socket as file descriptor 0. Then problems come : I create a BIO with BIO_new_socket(); then the ssl object and do the setbio() on this ssl object. Then SSL_accept() is called and application fails with "memory could not be written message". I've tryied to set the BIO using BIO_new_fd(). Since windows has problems with file descriptor and socket mixing. Damned, with this BIO it works strangely, in fact my client dumps this error : SSL: error:140920F8:SSL routines:SSL3_GET_SERVER_HELLO:unknown cipher returned But i have no segfault. I have also tryed to use: BIO_new(BIO_s_socket()) in order to retrieve to right method. No success, application segfaults too. I really tought that with this BIO methods, the lib will gives me the desired BIO to create my ssl object. I think there is a problem with this file descriptor 0 used as a socket. In fact when i don't createProcess and manage only one client, the socket is always the descriptor retrieved from accept() call, and there is no problem when i do a BIO_new_socket(), setbio() and ssl_accept(). All works great. Do you think i have to try to inherit socket in another handler than stdin ? Or maybe it is a problem in the openssl lib ? Version used is: openssl-0.9.7d thanks in advance Regards, NB: Same code (ssl context init, client verification setting, calist loading ...) with fork() is used with success under Unix. The only difference is that unix handles sockets as well as file descriptors with no difference. Write/send, read/recv could be used with fd or socket, not under windows. Maybe the bio is not able to be correctly set and leads to errors. Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]