Skip to content

Allow self-signed certificates #7

@Swimburger

Description

@Swimburger

ASP.NET Core by default use HTTP and HTTPS, but for HTTPS it uses a self-signed development certificate, which this plugin or node.js seems to take issue with.
I'm fine with this being a warning, or an error that can be overriden using a CLI argument.

The error I'm getting when running the following command:

twilio webhook:invoke https://localhost:7059/message -l debug
[DEBUG] Config File: /home/niels/.twilio-cli/config.json
[DEBUG] Using profile: ${TWILIO_ACCOUNT_SID}/${TWILIO_AUTH_TOKEN}
[DEBUG] Signature: "[REDACTED]"
[DEBUG] {"message":"self-signed certificate","name":"Error","stack":"Error: self-signed certificate\n    at TLSSocket.onConnectSecure (node:_tls_wrap:1545:34)\n    at TLSSocket.emit (node:events:513:28)\n    at TLSSocket._finishInit (node:_tls_wrap:959:8)\n    at ssl.onhandshakedone (node:_tls_wrap:743:12)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"*/*","Content-Type":"application/x-www-form-urlencoded","Accept-Encoding":"gzip","I-Twilio-Idempotency-Token":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","User-Agent":"TwilioProxy/1.1","X-Home-Region":"us1","X-Twilio-Signature":"[REDACTED]","Content-Length":560},"method":"post","url":"https://localhost:7059/message","data":"AccountSid=[REDACTED]&AddOns=%7B+%22status%22%3A+%22successful%22%2C+%22message%22%3A+null%2C+%22code%22%3A+null%2C+%22results%22%3A+%7B+%7D+%7D&ApiVersion=2010-04-01&From=%2B15017122661&FromCity=SAN+FRANCISCO&FromCountry=US&FromState=CA&FromZip=94903&To=%2B15558675310&ToCity=SAN+FRANCISCO&ToCountry=US&ToState=CA&ToZip=94105&Body=Ahoy&MessageSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&NumMedia=0&NumSegments=1&ReferralNumMedia=0&SmsMessageSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&SmsSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&SmsStatus=received"},"code":"DEPTH_ZERO_SELF_SIGNED_CERT","status":null}
 » self-signed certificate
[DEBUG] Found command "webhook:invoke" plugin: @twilio-labs/plugin-webhook
 » twilio-cli encountered an unexpected error. To report this issue, execute the command with the "-l debug" flag, then copy the output to a new issue here: "https://github.com/twilio-labs/plugin-webhook/issues"
[DEBUG] REQUEST_ERROR
[DEBUG] Error: REQUEST_ERROR
    at InvokeCommand.run (/home/niels/.twilio-cli/node_modules/@twilio-labs/plugin-webhook/src/commands/webhook/invoke.js:48:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async InvokeCommand._run (/home/niels/.twilio-cli/node_modules/@oclif/core/lib/command.js:80:22)
    at async Config.runCommand (/usr/local/lib/node_modules/twilio-cli/node_modules/@oclif/core/lib/config/config.js:272:25)
    at async Object.run (/usr/local/lib/node_modules/twilio-cli/node_modules/@oclif/core/lib/main.js:74:5)
 ›   Error: EEXIT: 1
 ›   Code: EEXIT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions