File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import * as pathlib from 'path';
99import * as assert from 'uvu/assert' ;
1010import * as crypto from 'crypto' ;
1111import * as selfsigned from 'selfsigned' ;
12+ import * as x509 from '@peculiar/x509' ;
1213import { suite } from 'uvu' ;
1314import { fileURLToPath } from 'url' ;
1415import { ExitResult , WireitTestRig } from './util/test-rig.js' ;
@@ -23,6 +24,13 @@ const __filename = fileURLToPath(import.meta.url);
2324const __dirname = pathlib . dirname ( __filename ) ;
2425const repoRoot = pathlib . resolve ( __dirname , '..' , '..' ) ;
2526
27+ if ( x509 . cryptoProvider . size === 0 ) {
28+ // On Node 18, the x509 library which selfsigned uses fails to find a crypto
29+ // provider (not sure why). This forces the Node-native one in there.
30+ // TODO(aomarks) Do we really need to use TLS for this test?
31+ x509 . cryptoProvider . set ( crypto . webcrypto ) ;
32+ }
33+
2634const SELF_SIGNED_CERT = await selfsigned . generate (
2735 [ { name : 'commonName' , value : 'localhost' } ] ,
2836 // More recent versions of TLS require a larger minimum key size than the
You can’t perform that action at this time.
0 commit comments