ZMediumToMarkdown 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/Request.rb +29 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1aa1f0af8244fcf2bdd9a86b9489f1ea6dbf26e8c89fc3246e9d999d4024469b
|
|
4
|
+
data.tar.gz: 9f2f90a605a0a1363bf4695f6e6f0940766c678597d4cb79853c058926037e9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0859f17b9a61ffcd7365941c6b5055b7bb0c4067efd32d43c59928667a8e7303258c7f8d6085fe8a5ce31e50bb11fa74d57f63752f53bd77d199e6cd200bbed5'
|
|
7
|
+
data.tar.gz: ce267ccddcaa2d565d24d7050b075648c2d4c6cfaff898ba8a7e52d79747b5a342a2f328176f6b1af79f0f73e05ee712a0a58afde29defacd7937e74f244734e
|
data/lib/Request.rb
CHANGED
|
@@ -11,6 +11,33 @@ class Request
|
|
|
11
11
|
https = Net::HTTP.new(uri.host, uri.port)
|
|
12
12
|
https.use_ssl = true
|
|
13
13
|
|
|
14
|
+
# --- TLS / Certificate verification setup ---
|
|
15
|
+
# Some OpenSSL builds/configs enable CRL checking, which can fail with:
|
|
16
|
+
# "certificate verify failed (unable to get certificate CRL)".
|
|
17
|
+
# Net::HTTP/OpenSSL does not automatically fetch CRLs, so we use a default
|
|
18
|
+
# cert store and clear CRL-related flags to avoid hard failures while still
|
|
19
|
+
# verifying the peer certificate.
|
|
20
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
21
|
+
|
|
22
|
+
store = OpenSSL::X509::Store.new
|
|
23
|
+
store.set_default_paths
|
|
24
|
+
# Ensure no CRL-check flags are enabled by default
|
|
25
|
+
store.flags = 0
|
|
26
|
+
https.cert_store = store
|
|
27
|
+
|
|
28
|
+
# Allow overriding CA bundle paths via environment variables if needed.
|
|
29
|
+
if ENV['SSL_CERT_FILE'] && !ENV['SSL_CERT_FILE'].empty?
|
|
30
|
+
https.ca_file = ENV['SSL_CERT_FILE']
|
|
31
|
+
end
|
|
32
|
+
if ENV['SSL_CERT_DIR'] && !ENV['SSL_CERT_DIR'].empty?
|
|
33
|
+
https.ca_path = ENV['SSL_CERT_DIR']
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# (Optional) timeouts to avoid hanging on network issues
|
|
37
|
+
https.open_timeout = 10
|
|
38
|
+
https.read_timeout = 30
|
|
39
|
+
# --- end TLS setup ---
|
|
40
|
+
|
|
14
41
|
if method.upcase == "GET"
|
|
15
42
|
request = Net::HTTP::Get.new(uri)
|
|
16
43
|
request['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0';
|
|
@@ -64,6 +91,8 @@ class Request
|
|
|
64
91
|
end
|
|
65
92
|
end
|
|
66
93
|
|
|
94
|
+
puts response.read_body
|
|
95
|
+
|
|
67
96
|
response
|
|
68
97
|
end
|
|
69
98
|
|