Skip to content

Commit

Permalink
Merge pull request #1115 from jembi/DATO-8-alpha-fix-tls-issue
Browse files Browse the repository at this point in the history
fix tls authentication issue
  • Loading branch information
de-laz authored Mar 26, 2021
2 parents 2b2e578 + 0e8fbbf commit a7bb40f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware/tlsAuthentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export async function koaMiddleware (ctx, next) {
await next()
} else if (ctx.req.client.authorized === true) {
const cert = ctx.req.connection.getPeerCertificate(true)
logger.info(`${cert.subject.CN} is authenticated via TLS.`)

// lookup client by cert fingerprint and set them as the authenticated user
try {
Expand All @@ -163,6 +162,7 @@ export async function koaMiddleware (ctx, next) {
ctx.header['X-OpenHIM-ClientID'] = ctx.authenticated.clientID
}
ctx.authenticationType = 'tls'
logger.info(`${cert.subject.CN} is authenticated via TLS.`)
await next()
} else {
ctx.authenticated = null
Expand Down

0 comments on commit a7bb40f

Please sign in to comment.