Skip to content

Commit c14d10c

Browse files
committed
Fix for #149
Fixes an error where a WebException would be "randomly" thrown when downloading an image
1 parent e0a2d17 commit c14d10c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Source/HtmlRenderer/Core/Handlers/ImageDownloader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ internal sealed class ImageDownloader : IDisposable
4848
/// </summary>
4949
private readonly Dictionary<string, List<DownloadFileAsyncCallback>> _imageDownloadCallbacks = new Dictionary<string, List<DownloadFileAsyncCallback>>();
5050

51+
public ImageDownloader()
52+
{
53+
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
54+
}
55+
5156
/// <summary>
5257
/// Makes a request to download the image from the server and raises the <see cref="cachedFileCallback"/> when it's down.<br/>
5358
/// </summary>

0 commit comments

Comments
 (0)