2012-10-29 3 views

답변

4

확인 사양 : 대상 URL이 바로 대상의 끝에서 :443을 추가 포트 443을 사용하는 것으로 예상된다

https://github.com/jnunemaker/httparty/blob/82a90c1b93b076f9d2d7410123c2b5d609401a1f/spec/httparty/request_spec.rb#L41

이 URI가 HTTParty 사용 SSL을 만들기에 충분해야한다.

그런데 HTTPS URL은 SSL도 사용합니다.

예 :

http://foo.com  => no SSL 
https://foo.com => SSL 
http://foo.com:443 => SSL 
+0

+1. URL에'https : //'를 지정하는 것이 가장 좋습니다. 포트의 기본값은 자동으로 443입니다. –

+0

@ 마크 토마스와 합의했습니다. 어쨌든 두 가지를 모두 사용할 수 있다는 것을 알고 있습니다. – robertodecurnex

3

포트가 80이고, 요청이 HTTP하지 않는 한 그것은 실제로 기본적으로 HTTPS를 사용

describe Foo do 
    it 'is https' do 
    adapter = HTTParty::ConnectionAdapter.new(URI(subject.base_uri)) 
    expect(adapter.connection.use_ssl?).to eq(true) 
    end 
end 
: 여기

https://github.com/jnunemaker/httparty/blob/master/spec/httparty/connection_adapter_spec.rb

context "using port 80" do 
    let(:uri) { URI 'http://foobar.com' } 
    it { should_not use_ssl } 
end 

context "using port 443 for ssl" do 
    let(:uri) { URI 'https://api.foo.com/v1:443' } 
    it { should use_ssl } 
end 

context "https scheme with default port" do 
    it { should use_ssl } 
end 

context "https scheme with non-standard port" do 
    let(:uri) { URI 'https://foobar.com:123456' } 
    it { should use_ssl } 
end 
내 사양입니다
관련 문제