@@ -7,6 +7,12 @@ public class CurlHttp : IDisposable
77{
88 static CurlHttp ( ) => LibCurl . curl_global_init ( LibCurl . CURL_GLOBAL_DEFAULT ) ;
99
10+ private static readonly string CurDir = Path . Join (
11+ Path . GetDirectoryName ( AppContext . BaseDirectory )
12+ ) ;
13+
14+ private static readonly string PathToCacert = Path . Join ( CurDir , "cacert.pem" ) ;
15+
1016 public static IEnumerable < string > FetchLines (
1117 string url ,
1218 Action < double > ? onSpeed = null ,
@@ -47,7 +53,7 @@ public static string Fetch(
4753 GCHandle . ToIntPtr ( writePin )
4854 ) ;
4955 LibCurl . curl_easy_setopt_long ( handle , LibCurl . CURLOPT_FOLLOWLOCATION , 1L ) ;
50- LibCurl . curl_easy_setopt_str ( handle , LibCurl . CURLOPT_CAINFO , "cacert.pem" ) ;
56+ LibCurl . curl_easy_setopt_str ( handle , LibCurl . CURLOPT_CAINFO , PathToCacert ) ;
5157 if ( http3 )
5258 LibCurl . curl_easy_setopt_long (
5359 handle ,
@@ -100,7 +106,7 @@ public static Dictionary<string, string> GetHeaders(
100106 GCHandle . ToIntPtr ( headerPin )
101107 ) ;
102108 LibCurl . curl_easy_setopt_long ( handle , LibCurl . CURLOPT_NOBODY , 1L ) ;
103- LibCurl . curl_easy_setopt_str ( handle , LibCurl . CURLOPT_CAINFO , "cacert.pem" ) ;
109+ LibCurl . curl_easy_setopt_str ( handle , LibCurl . CURLOPT_CAINFO , PathToCacert ) ;
104110 if ( http3 )
105111 LibCurl . curl_easy_setopt_long (
106112 handle ,
0 commit comments