xref: /third_party/node/test/parallel/test-tls-env-extra-ca-no-crypto.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst { fork } = require('child_process');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci// This test ensures that trying to load extra certs won't throw even when
81cb0ef41Sopenharmony_ci// there is no crypto support, i.e., built with "./configure --without-ssl".
91cb0ef41Sopenharmony_ciif (process.argv[2] === 'child') {
101cb0ef41Sopenharmony_ci  // exit
111cb0ef41Sopenharmony_ci} else {
121cb0ef41Sopenharmony_ci  const NODE_EXTRA_CA_CERTS = fixtures.path('keys', 'ca1-cert.pem');
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ci  fork(
151cb0ef41Sopenharmony_ci    __filename,
161cb0ef41Sopenharmony_ci    ['child'],
171cb0ef41Sopenharmony_ci    { env: { ...process.env, NODE_EXTRA_CA_CERTS } },
181cb0ef41Sopenharmony_ci  ).on('exit', common.mustCall(function(status) {
191cb0ef41Sopenharmony_ci    // Client did not succeed in connecting
201cb0ef41Sopenharmony_ci    assert.strictEqual(status, 0);
211cb0ef41Sopenharmony_ci  }));
221cb0ef41Sopenharmony_ci}
23

Indexes created Thu Nov 07 10:32:03 CST 2024