@@ -42,6 +42,7 @@ type daemon struct {
42
42
dhtMessenger * dhtpb.ProtocolMessenger
43
43
createTestHost func () (host.Host , error )
44
44
promRegistry * prometheus.Registry
45
+ httpSkipVerify bool
45
46
}
46
47
47
48
const (
@@ -252,7 +253,7 @@ func (d *daemon) runCidCheck(ctx context.Context, cidKey cid.Cid, ipniURL string
252
253
return
253
254
}
254
255
defer testHost .Close ()
255
- httpCheck := checkHTTPRetrieval (ctx , testHost , cidKey , httpInfo )
256
+ httpCheck := checkHTTPRetrieval (ctx , testHost , cidKey , httpInfo , d . httpSkipVerify )
256
257
provOutput .DataAvailableOverHTTP = httpCheck
257
258
if ! httpCheck .Connected {
258
259
provOutput .ConnectionError = httpCheck .Error
@@ -385,7 +386,7 @@ func (d *daemon) runPeerCheck(ctx context.Context, ma multiaddr.Multiaddr, ai pe
385
386
386
387
// If they provided an http address and enabled retrieval, try that.
387
388
if len (httpInfo .Addrs ) > 0 && httpRetrieval {
388
- httpCheck := checkHTTPRetrieval (ctx , testHost , c , httpInfo )
389
+ httpCheck := checkHTTPRetrieval (ctx , testHost , c , httpInfo , d . httpSkipVerify )
389
390
out .DataAvailableOverHTTP = httpCheck
390
391
if ! httpCheck .Connected {
391
392
out .ConnectionError = httpCheck .Error
@@ -520,7 +521,7 @@ func supportsHEAD(pstore peerstore.Peerstore, p peer.ID) bool {
520
521
return ok && b
521
522
}
522
523
523
- func checkHTTPRetrieval (ctx context.Context , host host.Host , c cid.Cid , pinfo peer.AddrInfo ) HTTPCheckOutput {
524
+ func checkHTTPRetrieval (ctx context.Context , host host.Host , c cid.Cid , pinfo peer.AddrInfo , skipVerify bool ) HTTPCheckOutput {
524
525
log .Printf ("Start of HTTP check for cid %s by attempting to connect to %s" , c , pinfo )
525
526
526
527
out := HTTPCheckOutput {
@@ -530,7 +531,7 @@ func checkHTTPRetrieval(ctx context.Context, host host.Host, c cid.Cid, pinfo pe
530
531
htnet := httpnet .New (host ,
531
532
httpnet .WithUserAgent (userAgent ),
532
533
httpnet .WithResponseHeaderTimeout (5 * time .Second ), // default: 10
533
- httpnet .WithInsecureSkipVerify (true ),
534
+ httpnet .WithInsecureSkipVerify (skipVerify ),
534
535
httpnet .WithHTTPWorkers (1 ),
535
536
)
536
537
defer htnet .Stop ()
0 commit comments