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