]> git.kaiwu.me - nginx.git/commitdiff
OCSP stapling: open ssl_stapling_file in binary-mode.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 3 Apr 2019 12:35:39 +0000 (15:35 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 3 Apr 2019 12:35:39 +0000 (15:35 +0300)
OCSP response uses the DER format and as such needs to be opened in binary-mode.
This only has any effect under Win32.

src/event/ngx_event_openssl_stapling.c

index 0bea5e74db74b282579b5b3931fa7315bd1f908d..7d0a1701f22c90a4e540c81ef48a16f8adc04b12 100644 (file)
@@ -227,7 +227,7 @@ ngx_ssl_stapling_file(ngx_conf_t *cf, ngx_ssl_t *ssl,
         return NGX_ERROR;
     }
 
-    bio = BIO_new_file((char *) file->data, "r");
+    bio = BIO_new_file((char *) file->data, "rb");
     if (bio == NULL) {
         ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
                       "BIO_new_file(\"%s\") failed", file->data);