-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1825607 Initial OCSP deprecation plan steps #973
base: master
Are you sure you want to change the base?
Conversation
It seems like the node.js driver does not have the use case that the responder URL does not exist according to the code: snowflake-connector-nodejs/lib/agent/check.js Line 176 in bada542
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #973 +/- ##
==========================================
- Coverage 88.93% 88.91% -0.02%
==========================================
Files 69 69
Lines 6748 6749 +1
==========================================
Hits 6001 6001
- Misses 747 748 +1 ☔ View full report in Codecov by Sentry. |
@@ -120,7 +115,7 @@ exports.secureSocket = function (socket, host, agent, mock) { | |||
function isOcspValidationDisabled(host) { | |||
// ocsp is disabled if insecure-connect is enabled, or if we've disabled ocsp | |||
// for non-snowflake endpoints and the host is a non-snowflake endpoint | |||
return GlobalConfig.isInsecureConnect() || | |||
return GlobalConfig.isOCSPChecksDisabled() || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this cover also a case when someone sets insecureMode
?
@@ -158,7 +153,7 @@ function canEarlyExitForOCSP(errors) { | |||
const err = errors[errorIndex]; | |||
if (err && !isValidOCSPError(err)) { | |||
// any of the errors is NOT good/revoked/unknown | |||
Logger.getInstance().warn(ocspFailOpenWarning + err); | |||
Logger.getInstance().debug('OCSP responder didn\'t respond correctly. Assuming certificate is not revoked'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave details as it was before?
const insecureConnect = options.insecureConnect; | ||
if (Util.exists(insecureConnect)) { | ||
if (Util.exists(options.insecureConnect)) { | ||
Logger.getInstance().warn('Warning! The option insecureConnect will be deprecated. Please use the disableOCSPChecks.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it is deprecated, not will be :)
Logger.getInstance().warn('Warning! The option insecureConnect will be deprecated. Please use the disableOCSPChecks.'); | ||
} | ||
|
||
const disableOCSPChecks = options.insecureConnect || options.disableOCSPChecks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are this values nullable? If yes and both are not null, disableOCSPChecks
should have precedence, not the alternative.
@@ -9,13 +9,13 @@ const assert = require('assert'); | |||
describe('OCSP mode', function () { | |||
it('getOcspMode', function (done) { | |||
// insecure mode | |||
GlobalConfig.setInsecureConnect(true); | |||
GlobalConfig.setDisableOCSPChecks(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have also a test confirming that insecureMode
still works?
@@ -15,7 +15,7 @@ describe('Snowflake Configure Tests', function () { | |||
before(function () { | |||
originalConfig = { | |||
logLevel: Logger.getInstance().getLevelTag(), | |||
insecureConnect: GlobalConfig.isInsecureConnect(), | |||
disableOCSPChecks: GlobalConfig.isOCSPChecksDisabled(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here + test for setting both values at once.
What you mentioned is not a responder URL - it is a cache server URL. Responder URL is provided in each certificate. |
OCSP Responder url != OCSP Cache URL. The (default) OCSP Cache URL is always the same, by default, However OCSP Responder URL is not from Snowflake. It is always hardcoded into the particular certificate, which is under verification. See this random cert as an example: https://crt.sh/?sha256=9c3f2fd11c57d7c649ad5a0932c0f0d29756f6a0a1c74c43e1e89a62d64cd320
It does not have OCSP endpoint. The driver today will complain if it encounters such certs which doesn't have the OCSP endpoint, because the driver expects the cert to have it. See this issue what exactly happens: #932 As a comparison, here's a cert which does have OCSP endpoint: https://crt.sh/?id=12092745633
(this section is missing from the first cert) The goal here, is for the driver if encountering a cert without the said OCSP endpoint, then it should just log the debug-level message and gracefully continue as if the verification was successful. edit: I see Piotr also pointed the same out while I was typing this message :) |
Description
Please explain the changes you made here.
disableOCSPChecks
introduced?insecureMode
?disableOCSPChecks
has precedence?Checklist
npm run lint:check -- CHANGED_FILES
and fix problems in changed code)npm run test:unit
andnpm run test:integration
)