Skip to content

Commit 2cdea45

Browse files
committed
Set defaults explicitly
1 parent 4886b02 commit 2cdea45

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

native/include/ssl_private.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,19 @@ extern ENGINE *tcn_ssl_engine;
212212
#define HAVE_ECC
213213
#endif
214214

215-
/* OCSP stapling */
215+
/* OCSP */
216216
#if !defined(OPENSSL_NO_OCSP) && defined(SSL_CTX_set_tlsext_status_cb)
217217
#define HAVE_OCSP
218-
#define OCSP_STATUS_OK 0
219-
#define OCSP_STATUS_REVOKED 1
220-
#define OCSP_STATUS_UNKNOWN 2
218+
#define OCSP_STATUS_OK 0
219+
#define OCSP_STATUS_REVOKED 1
220+
#define OCSP_STATUS_UNKNOWN 2
221+
#define OCSP_NO_CHECK_DEFAULT 1
222+
#define OCSP_SOFT_FAIL_DEFAULT 1
223+
#define OCSP_VERIFY_FLAGS_DEFAULT 0
221224
/* 15 minutes - aligns with JSSE */
222-
#define OCSP_MAX_SKEW 900
225+
#define OCSP_MAX_SKEW 900
226+
/* 15 seconds - aligns with JSSE*/
227+
#define OCSP_TIMEOUT_DEFAULT 15000000
223228
/* Older versions of OpenSSL have a smaller range of OCSP error codes*/
224229
#if !defined(X509_V_ERR_OCSP_RESP_INVALID)
225230
#define X509_V_ERR_OCSP_RESP_INVALID 96

native/src/sslconf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ TCN_IMPLEMENT_CALL(jlong, SSLConf, make)(TCN_STDARGS, jlong pool,
113113
c->cctx = cctx;
114114
c->pool = p;
115115

116+
/* OCSP defaults */
117+
c->no_ocsp_check = OCSP_NO_CHECK_DEFAULT;
118+
c->ocsp_soft_fail = OCSP_SOFT_FAIL_DEFAULT;
119+
c->ocsp_timeout = OCSP_TIMEOUT_DEFAULT;
120+
c->ocsp_verify_flags = OCSP_VERIFY_FLAGS_DEFAULT;
121+
116122
/*
117123
* Let us cleanup the SSL_CONF context when the pool is destroyed
118124
*/

0 commit comments

Comments
 (0)