Skip to content
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

Unable to specify CA cert bundle to override request default #481

Closed
barrybarrette opened this issue Sep 25, 2019 · 0 comments
Closed

Unable to specify CA cert bundle to override request default #481

barrybarrette opened this issue Sep 25, 2019 · 0 comments
Labels
difficulty: easy fix is easy in difficulty type: community enhancement feature request not on Twilio's roadmap

Comments

@barrybarrette
Copy link
Contributor

I'm troubleshooting local connectivity issues when using this module with my corporate security and came across this feature of Node that allows users to specify additional CA certs for making HTTPS requests. However, the Twilio client does not seem to respect this setting as I get the same error with the variable set or not.

Version:
3.35.0

Code Snippet

const dotenv = require('dotenv');
dotenv.config();
console.log(`Using extra certs: ${process.env.NODE_EXTRA_CA_CERTS}`)

const Twilio = require('twilio');

const startDate = new Date();
startDate.setHours(0, 0, 0, 0);
const client = new Twilio.Twilio(process.env.ACCOUNT_SID, process.env.AUTH_TOKEN);
client.taskrouter
    .workspaces(process.env.WORKSPACE_SID)
    .statistics('')
    .fetch({ taskChannel: 'voice', startDate }).then((stats) => {
    console.log(stats);
}).catch((error) => {
    console.log(error);
});

Exception/Log

Using extra certs: C:\path\to\my\cert.crt
{ Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1058:34)
    at TLSSocket.emit (events.js:198:13)
    at TLSSocket._finishInit (_tls_wrap.js:636:8) code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' }

Steps to Reproduce

  1. Be on a corporate network that requires an additional CA cert bundle
  2. Execute the above code
@barrybarrette barrybarrette changed the title Client not respecting NODE_EXTRA_CA_CERTS environment variable Unable to specify CA cert bundle to override request default Sep 25, 2019
@childish-sambino childish-sambino added difficulty: easy fix is easy in difficulty status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap and removed status: work in progress Twilio or the community is in the process of implementing labels Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

2 participants