|
I fixed the problem myself. For
anybody who looks into this in the future: Rather than creating an fd from the
HANDLE, then a FILE * from the fd, just create the fd and use BIO_new_fd
instead of BIO_new_fp. The FILE * created by fdopen is doing something incompatible
with named pipes. -- Justin From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Justin Marrese Hello, I have an application where we want to connect via SSL on both
TCP and on named pipes under windows. The TCP code works well, however I
get the following error when using pipes and I call SSL_connect: 288:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong
version number:.\ssl\s3_pkt.c:288 Because TCP versions of the same client and server connect
fine, I’m presuming I’m using the pipe wrong. This is how I
convert the pipe from a HANDLE, created with CreateNamedPipe (on the server) or
CreateFile (on the client), to a BIO to use with SSL:
ssl = SSL_new(ctx);
int fd =
_open_osfhandle((long)hPipe,
_O_RDWR | _O_BINARY);
FILE *fp = _fdopen( fd, "r+b" );
sbio = BIO_new_fp( fp , BIO_CLOSE); SSL_set_bio(ssl,
sbio, sbio); Does this yield a valid BIO? If so, why the version
mismatch error? Thanks for any ideas you can give me, -- Justin |
