import { existsSync, readFileSync } from 'node:fs';
export function getTlsConnectOptions(providerConfig) {
    const caCertPath = providerConfig.config.caCertPath?.trim();
    if (!caCertPath) {
        return {};
    }
    if (!existsSync(caCertPath)) {
        throw new Error(`CA certificate file not found: ${caCertPath}`);
    }
    const ca = readFileSync(caCertPath, 'utf8');
    if (!ca.trim()) {
        throw new Error(`CA certificate file is empty: ${caCertPath}`);
    }
    return { ca };
}
//# sourceMappingURL=tls-config.js.map