Index: ext/openssl/ossl_bio.c =================================================================== --- ext/openssl/ossl_bio.c (revision 22918) +++ ext/openssl/ossl_bio.c (working copy) @@ -20,7 +20,6 @@ if (TYPE(obj) == T_FILE) { rb_io_t *fptr; - FILE *fp; int fd; GetOpenFile(obj, fptr); @@ -28,12 +27,7 @@ if ((fd = dup(FPTR_TO_FD(fptr))) < 0){ rb_sys_fail(0); } - if (!(fp = fdopen(fd, "r"))){ - close(fd); - rb_sys_fail(0); - } - if (!(bio = BIO_new_fp(fp, BIO_CLOSE))){ - fclose(fp); + if (!(bio = BIO_new_file(RSTRING_PTR(fptr->pathv), "r"))){ ossl_raise(eOSSLError, NULL); } }