<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007a0CIGCA2Okta Classic EngineOkta Integration NetworkAnswered2022-04-20T16:14:48.000Z2022-04-19T14:08:17.000Z2022-04-20T16:14:48.000Z

AvitalL.20094 (Customer) asked a question.

Client network socket disconnected before secure TLS connection was established

Hi,

 

We've built a node.js website with an express server and connected it to the OKTA.

At first, it worked fine (for several weeks), but now we have an error:

 

The error:

RequestError: Client network socket disconnected before secure TLS connection was established.

 

Our code:

import { ExpressOIDC } from "@okta/oidc-middleware";

import * as session from "express-session";

 

export const register = ( app: any ) => {

    // Create the OIDC client

    const oidc = new ExpressOIDC( {

        client_id: process.env.OKTA_CLIENT_ID,

        client_secret: process.env.OKTA_CLIENT_SECRET,

        issuer: `${ process.env.OKTA_ORG_URL }/oauth2/default`,

        redirect_uri: `${ process.env.HOST_URL }/authorization-code/callback`,

        appBaseUrl:`${ process.env.HOST_URL }`,

        scope: "openid profile",

        // oidc middleware should default to 10000ms.

        // getting timeout errors at 2500, so making sure it's set here.

        timeout: 10000

    } );

 

    // Configure Express to use authentication sessions

    app.use( session( {

        resave: true,

        saveUninitialized: false,

        secret: process.env.SESSION_SECRET

    } ) );

 

    // Configure Express to use the OIDC client router

    app.use( oidc.router );

 

    // add the OIDC client to the app.locals

    app.locals.oidc = oidc;

};


This question is closed.
Loading
Client network socket disconnected before secure TLS connection was established
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply