@@ -143,6 +143,7 @@ struct modConfData_s {
143
143
uchar * myCertFile ; /* File holding cert corresponding to private key used for client cert auth */
144
144
uchar * myPrivKeyFile ; /* File holding private key corresponding to cert used for client cert auth */
145
145
sbool allowUnsignedCerts ; /* For testing/debugging - do not check for CA certs (CURLOPT_SSL_VERIFYPEER FALSE) */
146
+ sbool skipVerifyHost ; /* For testing/debugging - skip cert hostname verify (CURLOPT_SSL_VERIFYHOST FALSE) */
146
147
uchar * token ; /* The token value to use to authenticate to Kubernetes - takes precedence over tokenFile */
147
148
uchar * tokenFile ; /* The file whose contents is the token value to use to authenticate to Kubernetes */
148
149
sbool de_dot ; /* If true (default), convert '.' characters in labels & annotations to de_dot_separator */
@@ -168,6 +169,7 @@ typedef struct _instanceData {
168
169
uchar * myCertFile ; /* File holding cert corresponding to private key used for client cert auth */
169
170
uchar * myPrivKeyFile ; /* File holding private key corresponding to cert used for client cert auth */
170
171
sbool allowUnsignedCerts ; /* For testing/debugging - do not check for CA certs (CURLOPT_SSL_VERIFYPEER FALSE) */
172
+ sbool skipVerifyHost ; /* For testing/debugging - skip cert hostname verify (CURLOPT_SSL_VERIFYHOST FALSE) */
171
173
uchar * token ; /* The token value to use to authenticate to Kubernetes - takes precedence over tokenFile */
172
174
uchar * tokenFile ; /* The file whose contents is the token value to use to authenticate to Kubernetes */
173
175
sbool de_dot ; /* If true (default), convert '.' characters in labels & annotations to de_dot_separator */
@@ -223,6 +225,7 @@ static struct cnfparamdescr modpdescr[] = {
223
225
{ "tls.mycert" , eCmdHdlrString , 0 },
224
226
{ "tls.myprivkey" , eCmdHdlrString , 0 },
225
227
{ "allowunsignedcerts" , eCmdHdlrBinary , 0 },
228
+ { "skipverifyhost" , eCmdHdlrBinary , 0 },
226
229
{ "token" , eCmdHdlrString , 0 },
227
230
{ "tokenfile" , eCmdHdlrString , 0 },
228
231
{ "annotation_match" , eCmdHdlrArray , 0 },
@@ -255,6 +258,7 @@ static struct cnfparamdescr actpdescr[] = {
255
258
{ "tls.mycert" , eCmdHdlrString , 0 },
256
259
{ "tls.myprivkey" , eCmdHdlrString , 0 },
257
260
{ "allowunsignedcerts" , eCmdHdlrBinary , 0 },
261
+ { "skipverifyhost" , eCmdHdlrBinary , 0 },
258
262
{ "token" , eCmdHdlrString , 0 },
259
263
{ "tokenfile" , eCmdHdlrString , 0 },
260
264
{ "annotation_match" , eCmdHdlrArray , 0 },
@@ -637,6 +641,8 @@ CODESTARTsetModCnf
637
641
}
638
642
} else if (!strcmp (modpblk .descr [i ].name , "allowunsignedcerts" )) {
639
643
loadModConf -> allowUnsignedCerts = pvals [i ].val .d .n ;
644
+ } else if (!strcmp (modpblk .descr [i ].name , "skipverifyhost" )) {
645
+ loadModConf -> skipVerifyHost = pvals [i ].val .d .n ;
640
646
} else if (!strcmp (modpblk .descr [i ].name , "token" )) {
641
647
free (loadModConf -> token );
642
648
loadModConf -> token = (uchar * ) es_str2cstr (pvals [i ].val .d .estr , NULL );
@@ -954,6 +960,8 @@ CODESTARTcreateWrkrInstance
954
960
curl_easy_setopt (ctx , CURLOPT_SSLKEY , pWrkrData -> pData -> myPrivKeyFile );
955
961
if (pWrkrData -> pData -> allowUnsignedCerts )
956
962
curl_easy_setopt (ctx , CURLOPT_SSL_VERIFYPEER , 0 );
963
+ if (pWrkrData -> pData -> skipVerifyHost )
964
+ curl_easy_setopt (ctx , CURLOPT_SSL_VERIFYHOST , 0 );
957
965
#if defined(SUPPORT_SSL_PARTIAL_CHAIN )
958
966
if (pWrkrData -> pData -> sslPartialChain ) {
959
967
curl_easy_setopt (ctx , CURLOPT_SSL_CTX_FUNCTION , set_ssl_partial_chain );
@@ -1257,6 +1265,7 @@ CODESTARTnewActInst
1257
1265
1258
1266
pData -> de_dot = loadModConf -> de_dot ;
1259
1267
pData -> allowUnsignedCerts = loadModConf -> allowUnsignedCerts ;
1268
+ pData -> skipVerifyHost = loadModConf -> skipVerifyHost ;
1260
1269
pData -> busyRetryInterval = loadModConf -> busyRetryInterval ;
1261
1270
pData -> sslPartialChain = loadModConf -> sslPartialChain ;
1262
1271
pData -> cacheEntryTTL = loadModConf -> cacheEntryTTL ;
@@ -1322,6 +1331,8 @@ CODESTARTnewActInst
1322
1331
}
1323
1332
} else if (!strcmp (actpblk .descr [i ].name , "allowunsignedcerts" )) {
1324
1333
pData -> allowUnsignedCerts = pvals [i ].val .d .n ;
1334
+ } else if (!strcmp (actpblk .descr [i ].name , "skipverifyhost" )) {
1335
+ pData -> skipVerifyHost = pvals [i ].val .d .n ;
1325
1336
} else if (!strcmp (actpblk .descr [i ].name , "token" )) {
1326
1337
free (pData -> token );
1327
1338
pData -> token = (uchar * ) es_str2cstr (pvals [i ].val .d .estr , NULL );
@@ -1566,6 +1577,7 @@ CODESTARTdbgPrintInstInfo
1566
1577
dbgprintf ("\ttls.mycert='%s'\n" , pData -> myCertFile );
1567
1578
dbgprintf ("\ttls.myprivkey='%s'\n" , pData -> myPrivKeyFile );
1568
1579
dbgprintf ("\tallowUnsignedCerts='%d'\n" , pData -> allowUnsignedCerts );
1580
+ dbgprintf ("\tskipVerifyHost='%d'\n" , pData -> skipVerifyHost );
1569
1581
dbgprintf ("\ttoken='%s'\n" , pData -> token );
1570
1582
dbgprintf ("\ttokenFile='%s'\n" , pData -> tokenFile );
1571
1583
dbgprintf ("\tde_dot='%d'\n" , pData -> de_dot );
0 commit comments