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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Request.rb +29 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ac9397e4e66a9b14d08c1d9a6d77b61141549d3e7d0b94f4852386898737247
4
- data.tar.gz: bcc9ac34cd734923b0cb57032755bada22bbd3e640e77e0f5b6ca0872afe7279
3
+ metadata.gz: 1aa1f0af8244fcf2bdd9a86b9489f1ea6dbf26e8c89fc3246e9d999d4024469b
4
+ data.tar.gz: 9f2f90a605a0a1363bf4695f6e6f0940766c678597d4cb79853c058926037e9a
5
5
  SHA512:
6
- metadata.gz: 85a94b063636c2f811704aa2f09328a584b72db9b6f251b7b3b3d67962a92861f9f3feac86026b1e33a10231ac598a76913bb8b8f0bde28d20623d7f752e6b9e
7
- data.tar.gz: eeefcac037b99ba98ccb337bcb5b89fcdb3711ba732e4321c444c47fefa765fb682a2b0e30b8e990d2b738be0c1ccf2bacde2d822c95fde48dbd814c4d8891fe
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.3
4
+ version: 2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi