Using IBM API Studio with self-signed certificates
Learn how to configure IBM API Studio to connect to API Gateway instances that use self-signed certificates.
Symptom
IBM API Studio fails to connect to an API Gateway that uses a self-signed certificate.
The following error can occur:
SSL certificate validation failed
Cause
IBM API Studio enforces TLS certificate validation by default. Self-signed certificates are not trusted by default, so the certificate validation fails.
IBM API Studio does not provide an option to disable SSL validation within the application.
Solution
To connect to API Gateway instances that use self-signed certificates in development or sandbox environments, set the NODE_TLS_REJECT_UNAUTHORIZED=0 environment variable and start IBM API Studio from the same session.
Disable SSL validation
Windows
- Command Prompt
set NODE_TLS_REJECT_UNAUTHORIZED=0 && start "C:\Path\to\your-api-studio-exe-file.exe" - PowerShell
$env:NODE_TLS_REJECT_UNAUTHORIZED="0"; Start-Process "C:\Path\to\your-api-studio-exe-file.exe" - Batch file
Create a batch file named start-api-studio-dev.bat with the following content, then run this file to start IBM API Studio with SSL validation disabled.
@echo off set NODE_TLS_REJECT_UNAUTHORIZED=0 start "C:\Path\to\your-api-studio-exe-file.exe"
Replace C:\Path\to\your-api-studio-exe-file.exe with the actual installation path and executable file name.
macOS
- Terminal
Run the following command to start IBM API Studio with SSL validation disabled:
export NODE_TLS_REJECT_UNAUTHORIZED=0 && open "/Applications/your-api-studio.app"Replace /Applications/your-api-studio-exe-file.app with the actual installation path and application name.
How it works
NODE_TLS_REJECT_UNAUTHORIZED=0 instructs Node.js to skip TLS certificate validation for HTTPS connections. This allows IBM API Studio to connect to endpoints that use self-signed certificates.
Restart requirement
- Close all running instances of IBM API Studio before running the commands.
- Start IBM API Studio again after setting the environment variable so that the change takes effect.