Skip to content

LTC: InternalOAuthError: Failed to obtain access token #968

@jirik

Description

@jirik

On some servers with not-so-secure SSL configuration, Layman Test Client (LTC) fails during authentication with error

InternalOAuthError: Failed to obtain access token
    at OAuth2Strategy._createOAuthError (/code/node_modules/passport-oauth2/lib/strategy.js:423:17)
    at /code/node_modules/passport-oauth2/lib/strategy.js:177:45
    at /code/node_modules/oauth/lib/oauth2.js:191:18
    at ClientRequest.<anonymous> (/code/node_modules/oauth/lib/oauth2.js:162:5)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
_app.js getInitialProps
_app.js constructor pageProps={"num_authn_providers":1}

or

Failed to obtain access token:  Error: write EPROTO B84BF55A1D7F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:921:

    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
  errno: -71,
  code: 'EPROTO',
  syscall: 'write'
}
InternalOAuthError: Failed to obtain access token
    at OAuth2Strategy._createOAuthError (/code/node_modules/passport-oauth2/lib/strategy.js:426:17)
    at /code/node_modules/passport-oauth2/lib/strategy.js:179:36
    at /code/node_modules/oauth/lib/oauth2.js:191:18
    at ClientRequest.<anonymous> (/code/node_modules/oauth/lib/oauth2.js:162:5)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

It seems to have the same cause as #798.

LTC uses Node.js v18 since Layman 1.19.0, so probably all Layman versions from 1.19.0 to 1.22.2 are affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions