@@ -194,3 +194,36 @@ garbage collected, whichever comes first. If the grace period is set to zero,
194194all resources will be cleaned up immediately as soon as there are no more
195195ongoing downloads in progress. If the grace period is set to ` Inf ` then
196196resources are not cleaned up until ` Downloader ` is garbage collected.
197+
198+
199+ ## Mutual TLS using Downloads
200+
201+ ``` jl
202+ using Downloads: Curl, Downloader, download
203+
204+ easy_hook = (easy, info) -> begin
205+ Curl. setopt (easy, Curl. CURLOPT_SSLKEY, " client.key" )
206+ Curl. setopt (easy, Curl. CURLOPT_SSLCERT, " client.crt" )
207+ end
208+ downloader = Downloader ()
209+ downloader. easy_hook = easy_hook
210+
211+ download (url; downloader)
212+ ```
213+
214+ Here, client.key and client.crt are the private and public keys for the client.
215+
216+ It’s also possible currently to make the default downloader use that hook by putting it into Downloads.EASY_HOOK. Here’s an example:
217+
218+ ``` jl
219+ using Downloads: Downloads, Curl, download
220+
221+ Downloads. EASY_HOOK[] = (easy, info) -> begin
222+ Curl. setopt (easy, Curl. CURLOPT_SSLKEY, " client.key" )
223+ Curl. setopt (easy, Curl. CURLOPT_SSLCERT, " client.crt" )
224+ end
225+
226+ download (url)
227+ ```
228+
229+ There is no difference between usage on Windows, MacOS, and Linux.
0 commit comments