Skip to content

Commit

Permalink
fix: acknowledging tls client auth draft fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 12, 2019
1 parent 161a52a commit 02df82a
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions lib/helpers/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,29 +444,37 @@ module.exports = class Configuration {
});

/* eslint-disable no-restricted-syntax */
for (const endpoint of AUTH_ENDPOINTS) {
if (
this[`${endpoint}EndpointAuthMethods`].has('tls_client_auth')
&& this[`${endpoint}EndpointAuthMethods`].ack !== DRAFTS.get('tlsClientAuth').version
) {
ENABLED_DRAFTS.add('tlsClientAuth');
if (typeof this[`${endpoint}EndpointAuthMethods`].ack !== 'undefined') {
throwDraft = true;
{
const draft = DRAFTS.get('tlsClientAuth');
for (const endpoint of AUTH_ENDPOINTS) {
const { ack } = this[`${endpoint}EndpointAuthMethods`];
if (
this[`${endpoint}EndpointAuthMethods`].has('tls_client_auth')
&& (Array.isArray(draft.version) ? !draft.version.includes(ack) : ack !== draft.version)
) {
ENABLED_DRAFTS.add('tlsClientAuth');
if (typeof ack !== 'undefined') {
throwDraft = true;
}
break;
}
break;
}
}

for (const endpoint of AUTH_ENDPOINTS) {
if (
this[`${endpoint}EndpointAuthMethods`].has('self_signed_tls_client_auth')
&& this[`${endpoint}EndpointAuthMethods`].ack !== DRAFTS.get('selfSignedTlsClientAuth').version
) {
ENABLED_DRAFTS.add('selfSignedTlsClientAuth');
if (typeof this[`${endpoint}EndpointAuthMethods`].ack !== 'undefined') {
throwDraft = true;
{
const draft = DRAFTS.get('selfSignedTlsClientAuth');
for (const endpoint of AUTH_ENDPOINTS) {
const { ack } = this[`${endpoint}EndpointAuthMethods`];
if (
this[`${endpoint}EndpointAuthMethods`].has('self_signed_tls_client_auth')
&& (Array.isArray(draft.version) ? !draft.version.includes(ack) : ack !== draft.version)
) {
ENABLED_DRAFTS.add('selfSignedTlsClientAuth');
if (typeof ack !== 'undefined') {
throwDraft = true;
}
break;
}
break;
}
}
/* eslint-enable */
Expand Down

0 comments on commit 02df82a

Please sign in to comment.