()
| 98 | * Get TLS options for WebSocket connections |
| 99 | */ |
| 100 | export function getWebSocketTLSOptions(): tls.ConnectionOptions | undefined { |
| 101 | const mtlsConfig = getMTLSConfig() |
| 102 | const caCerts = getCACertificates() |
| 103 | |
| 104 | if (!mtlsConfig && !caCerts) { |
| 105 | return undefined |
| 106 | } |
| 107 | |
| 108 | return { |
| 109 | ...mtlsConfig, |
| 110 | ...(caCerts && { ca: caCerts }), |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Get fetch options with TLS configuration (mTLS + CA certs) for undici |
no outgoing calls
no test coverage detected