manticore 0.7.1-java → 0.8.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67e67c0611ad51fbaf279f456ef5a9e463038f1017c0eb8c7665032a05534b59
4
- data.tar.gz: 0ecf2a3014befbbc5b26d95c3ee36809ccc8605e450631e4ec0f1c143225bbc5
3
+ metadata.gz: 063b0fd32e3dfbee4335d04293e098e8b1bc054ecd727ff51011e6eef3675c4b
4
+ data.tar.gz: 8a5da3e5e6433d7d57e388069e95393fbc66220f1695ab7b1443f9dc49f84d11
5
5
  SHA512:
6
- metadata.gz: 19f7db686cff19817b8310f7838f9115d343ab7516e7cbab066c0f0f7d223c7a0a42c40f9e361426c07345088dbdb818cabab59fb2a481d35050f939e27afafd
7
- data.tar.gz: ebc35118980baac6eff3e1f795f5ad3aa0af01c7ac29cd6a9502f9300fb1da88d8b97ecfc7c1198d5902a35ab2501179df775791e3306e27004e85d690145bc2
6
+ metadata.gz: db22357ef64973e1452bb970dbb2d7a6c960c895db7d0afe1ae96339f414a06dba8c1039b7f5d3d0ce493443317a9d72c7dce04e7c7fbab98704e55e124d2766
7
+ data.tar.gz: 6744d52a35f0e94d23db237b9f364353eeec4bb3667eb35a06620cf16b676e5b49bd76bb12ba7296f6924b2b7ae052cb4f1d443a6f1e87b00d32b9d1af60c507
data/.travis.yml CHANGED
@@ -5,7 +5,7 @@ cache:
5
5
  - directories:
6
6
  - $HOME/.m2
7
7
  rvm:
8
- - jruby-9.2.16.0 # Ruby 2.5
8
+ - jruby-9.2.19.0 # Ruby 2.5
9
9
  jdk:
10
10
  - oraclejdk8
11
11
  - openjdk8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### v0.8.0
2
+
3
+ * [feat] restore compat with (legacy) verify: false (#102)
4
+ * Accept untrusted certs when SSL verify is disabled (#100)
5
+ * [deps] update http-client to 4.5.13 (#99)
6
+
1
7
  ## v0.7
2
8
 
3
9
  ### v0.7.1
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Note**: While I'll continue to maintain the library here, I've moved the canonical copy to Gitlab at https://gitlab.com/cheald/manticore - it is preferred that you submit issues and PRs there.
4
4
 
5
- [![Build Status](https://travis-ci.org/cheald/manticore.svg?branch=master)](https://travis-ci.org/cheald/manticore)
5
+ [![Build Status](https://app.travis-ci.com/cheald/manticore.svg?branch=master)](https://app.travis-ci.com/cheald/manticore)
6
6
 
7
7
  Manticore is a fast, robust HTTP client built on the Apache HTTPClient libraries. It is only compatible with JRuby.
8
8
 
data/Rakefile CHANGED
@@ -36,6 +36,7 @@ task :generate_certs do
36
36
  # Create the CA
37
37
  "#{openssl} genrsa 4096 | #{openssl} pkcs8 -topk8 -nocrypt -out #{root}/root-ca.key",
38
38
  "#{openssl} req -sha256 -x509 -newkey rsa:4096 -nodes -key #{root}/root-ca.key -sha256 -days 365 -out #{root}/root-ca.crt -subj \"/C=US/ST=The Internet/L=The Internet/O=Manticore CA/OU=Manticore/CN=localhost\"",
39
+ "#{openssl} req -sha256 -x509 -newkey rsa:4096 -nodes -key #{root}/root-ca.key -sha256 -days 365 -out #{root}/root-untrusted-ca.crt -subj \"/C=US/ST=The Darknet/L=The Darknet/O=Manticore CA/OU=Manticore/CN=localhost\"",
39
40
 
40
41
  # Create the client CSR, key, and signed cert
41
42
  "#{openssl} genrsa 4096 | #{openssl} pkcs8 -topk8 -nocrypt -out #{root}/client.key",
@@ -48,6 +49,7 @@ task :generate_certs do
48
49
  "#{openssl} req -sha256 -key #{root}/host.key -newkey rsa:4096 -out #{root}/host.csr -subj \"/C=US/ST=The Internet/L=The Internet/O=Manticore Host/OU=Manticore/CN=localhost\"",
49
50
  "#{openssl} x509 -req -in #{root}/host.csr -CA #{root}/root-ca.crt -CAkey #{root}/root-ca.key -CAcreateserial -out #{root}/host.crt -sha256 -days 1",
50
51
  "#{openssl} x509 -req -in #{root}/host.csr -CA #{root}/root-ca.crt -CAkey #{root}/root-ca.key -CAcreateserial -out #{root}/host-expired.crt -sha256 -days -7",
52
+ "#{openssl} x509 -req -in #{root}/host.csr -CA #{root}/root-untrusted-ca.crt -CAkey #{root}/root-ca.key -CAcreateserial -out #{root}/host-untrusted.crt -sha256 -days 1",
51
53
 
52
54
  "#{keytool} -import -file #{root}/root-ca.crt -alias rootCA -keystore #{root}/truststore.jks -noprompt -storepass test123",
53
55
  "#{openssl} pkcs12 -export -clcerts -out #{root}/client.p12 -inkey #{root}/client.key -in #{root}/client.crt -certfile #{root}/root-ca.crt -password pass:test123",
@@ -88,6 +88,7 @@ module Manticore
88
88
  java_import "org.apache.http.auth.UsernamePasswordCredentials"
89
89
  java_import "org.apache.http.conn.ssl.SSLConnectionSocketFactory"
90
90
  java_import "org.apache.http.conn.ssl.SSLContextBuilder"
91
+ java_import "org.apache.http.conn.ssl.TrustAllStrategy"
91
92
  java_import "org.apache.http.conn.ssl.TrustSelfSignedStrategy"
92
93
  java_import "org.apache.http.client.utils.URIBuilder"
93
94
  java_import "org.apache.http.impl.DefaultConnectionReuseStrategy"
@@ -611,11 +612,14 @@ module Manticore
611
612
  def ssl_socket_factory_from_options(ssl_options)
612
613
  trust_store = trust_strategy = nil
613
614
 
614
- verifier = SSLConnectionSocketFactory::STRICT_HOSTNAME_VERIFIER
615
615
  case ssl_options.fetch(:verify, :strict)
616
- when false, :disable, :none
616
+ when false
617
617
  trust_store = nil
618
- trust_strategy = TrustSelfSignedStrategy.new
618
+ trust_strategy = TrustSelfSignedStrategy::INSTANCE
619
+ verifier = SSLConnectionSocketFactory::ALLOW_ALL_HOSTNAME_VERIFIER
620
+ when :disable, :none
621
+ trust_store = nil
622
+ trust_strategy = TrustAllStrategy::INSTANCE
619
623
  verifier = SSLConnectionSocketFactory::ALLOW_ALL_HOSTNAME_VERIFIER
620
624
  when :browser
621
625
  verifier = SSLConnectionSocketFactory::BROWSER_COMPATIBLE_HOSTNAME_VERIFIER
@@ -1,3 +1,3 @@
1
1
  module Manticore
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -1,8 +1,18 @@
1
1
  # this is a generated file, to avoid over-writing it just delete this comment
2
- require "jar_dependencies"
2
+ begin
3
+ require 'jar_dependencies'
4
+ rescue LoadError
5
+ require 'commons-logging/commons-logging/1.2/commons-logging-1.2.jar'
6
+ require 'commons-codec/commons-codec/1.15/commons-codec-1.15.jar'
7
+ require 'org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar'
8
+ require 'org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar'
9
+ require 'org/apache/httpcomponents/httpmime/4.5.13/httpmime-4.5.13.jar'
10
+ end
3
11
 
4
- require_jar("commons-logging", "commons-logging", "1.2")
5
- require_jar("org.apache.httpcomponents", "httpmime", "4.5.2")
6
- require_jar("commons-codec", "commons-codec", "1.10")
7
- require_jar("org.apache.httpcomponents", "httpclient", "4.5.2")
8
- require_jar("org.apache.httpcomponents", "httpcore", "4.4.4")
12
+ if defined? Jars
13
+ require_jar 'commons-logging', 'commons-logging', '1.2'
14
+ require_jar 'commons-codec', 'commons-codec', '1.15'
15
+ require_jar 'org.apache.httpcomponents', 'httpcore', '4.4.14'
16
+ require_jar 'org.apache.httpcomponents', 'httpclient', '4.5.13'
17
+ require_jar 'org.apache.httpcomponents', 'httpmime', '4.5.13'
18
+ end
Binary file
data/manticore.gemspec CHANGED
@@ -33,9 +33,9 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "rake"
34
34
  spec.add_development_dependency "jar-dependencies", "~> 0.4.1"
35
35
 
36
- spec.requirements << "jar org.apache.httpcomponents:httpclient, '~> 4.5.0'"
37
- spec.requirements << "jar org.apache.httpcomponents:httpmime, '~> 4.5.0'"
36
+ spec.requirements << "jar org.apache.httpcomponents:httpclient, '~> 4.5.13'"
37
+ spec.requirements << "jar org.apache.httpcomponents:httpmime, '~> 4.5.13'"
38
38
  spec.requirements << "jar commons-logging:commons-logging, '~> 1.2'"
39
39
  spec.requirements << "jar commons-codec:commons-codec, '~> 1.9'"
40
- spec.requirements << "jar org.apache.httpcomponents:httpcore, '~> 4.4.4'"
40
+ spec.requirements << "jar org.apache.httpcomponents:httpcore, '~> 4.4.14'"
41
41
  end
@@ -233,6 +233,10 @@ describe Manticore::Client do
233
233
  it "does not break on expired SSL certificates" do
234
234
  expect { client.get("https://localhost:55446/").body }.to_not raise_exception
235
235
  end
236
+
237
+ it "does not break on untrusted certificates" do
238
+ expect { client.get("https://localhost:55447/").body }.to_not raise_exception
239
+ end
236
240
  end
237
241
 
238
242
  context "against a server that verifies clients" do
data/spec/spec_helper.rb CHANGED
@@ -151,6 +151,7 @@ RSpec.configure do |c|
151
151
  start_ssl_server 55444
152
152
  start_ssl_server 55445, :SSLVerifyClient => OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT, :SSLCACertificateFile => File.expand_path("../ssl/root-ca.crt", __FILE__)
153
153
  start_ssl_server 55446, cert: File.expand_path("../ssl/host-expired.crt", __FILE__)
154
+ start_ssl_server 55447, cert: File.expand_path("../ssl/host-untrusted.crt", __FILE__), SSLCACertificateFile: File.expand_path("../ssl/root-untrusted-ca.crt", __FILE__)
154
155
 
155
156
  Manticore.disable_httpcomponents_logging!
156
157
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manticore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: java
6
6
  authors:
7
7
  - Chris Heald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -17,8 +17,8 @@ dependencies:
17
17
  - !ruby/object:Gem::Version
18
18
  version: '0'
19
19
  name: openssl_pkcs8_pure
20
- type: :runtime
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
@@ -31,8 +31,8 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
33
  name: bundler
34
- type: :development
35
34
  prerelease: false
35
+ type: :development
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
@@ -45,8 +45,8 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  name: rake
48
- type: :development
49
48
  prerelease: false
49
+ type: :development
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
@@ -59,8 +59,8 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.4.1
61
61
  name: jar-dependencies
62
- type: :development
63
62
  prerelease: false
63
+ type: :development
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
@@ -86,7 +86,7 @@ files:
86
86
  - ext/manticore/org/manticore/HttpGetWithEntity.java
87
87
  - ext/manticore/org/manticore/Manticore.java
88
88
  - gem-public_cert.pem
89
- - lib/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
89
+ - lib/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
90
90
  - lib/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
91
91
  - lib/faraday/adapter/manticore.rb
92
92
  - lib/manticore.rb
@@ -99,9 +99,9 @@ files:
99
99
  - lib/manticore/stubbed_response.rb
100
100
  - lib/manticore/version.rb
101
101
  - lib/manticore_jars.rb
102
- - lib/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar
103
- - lib/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar
104
- - lib/org/apache/httpcomponents/httpmime/4.5.2/httpmime-4.5.2.jar
102
+ - lib/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
103
+ - lib/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar
104
+ - lib/org/apache/httpcomponents/httpmime/4.5.13/httpmime-4.5.13.jar
105
105
  - lib/org/manticore/manticore-ext.jar
106
106
  - manticore.gemspec
107
107
  - spec/manticore/client_proxy_spec.rb
@@ -131,12 +131,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements:
134
- - jar org.apache.httpcomponents:httpclient, '~> 4.5.0'
135
- - jar org.apache.httpcomponents:httpmime, '~> 4.5.0'
134
+ - jar org.apache.httpcomponents:httpclient, '~> 4.5.13'
135
+ - jar org.apache.httpcomponents:httpmime, '~> 4.5.13'
136
136
  - jar commons-logging:commons-logging, '~> 1.2'
137
137
  - jar commons-codec:commons-codec, '~> 1.9'
138
- - jar org.apache.httpcomponents:httpcore, '~> 4.4.4'
139
- rubygems_version: 3.0.6
138
+ - jar org.apache.httpcomponents:httpcore, '~> 4.4.14'
139
+ rubygems_version: 3.1.6
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Manticore is an HTTP client built on the Apache HttpCore components