@@ -14,6 +14,9 @@ import { tls as cert1, expiredTls as cert2 } from "harness";
14
14
const CERT_LOCALHOST_IP = { ...cert1 } ;
15
15
const CERT_EXPIRED = { ...cert2 } ;
16
16
17
+ // Note: Do not use bun.sh as the example domain
18
+ // Cloudflare sometimes blocks automated requests to it.
19
+ // so it will cause flaky tests.
17
20
async function createServer ( cert : TLSOptions , callback : ( port : number ) => Promise < any > ) {
18
21
using server = Bun . serve ( {
19
22
port : 0 ,
@@ -48,7 +51,7 @@ it("can handle multiple requests with non native checkServerIdentity", async ()
48
51
} ) ;
49
52
50
53
it ( "fetch with valid tls should not throw" , async ( ) => {
51
- const promises = [ `https://bun.sh ` , `https://www.example.com` ] . map ( async url => {
54
+ const promises = [ `https://example.com ` , `https://www.example.com` ] . map ( async url => {
52
55
const result = await fetch ( url , { keepalive : false } ) . then ( ( res : Response ) => res . blob ( ) ) ;
53
56
expect ( result ?. size ) . toBeGreaterThan ( 0 ) ;
54
57
} ) ;
@@ -58,7 +61,7 @@ it("fetch with valid tls should not throw", async () => {
58
61
59
62
it ( "fetch with valid tls and non-native checkServerIdentity should work" , async ( ) => {
60
63
let count = 0 ;
61
- const promises = [ `https://bun.sh ` , `https://www.example.com` ] . map ( async url => {
64
+ const promises = [ `https://example.com ` , `https://www.example.com` ] . map ( async url => {
62
65
await fetch ( url , {
63
66
keepalive : false ,
64
67
tls : {
@@ -123,7 +126,7 @@ it("fetch with invalid tls should throw", async () => {
123
126
124
127
it ( "fetch with checkServerIdentity failing should throw" , async ( ) => {
125
128
try {
126
- await fetch ( `https://bun.sh ` , {
129
+ await fetch ( `https://example.com ` , {
127
130
keepalive : false ,
128
131
tls : {
129
132
checkServerIdentity ( ) {
0 commit comments