2014-10-28 9 views
0

내가 루비, 나는 SSL_connect SYSCALL 반환있어 = 5의 errno = 0

에 SSL

를 통해 서버에 일부 데이터를 넣어 POST를 사용

을이 컬 스크립트를 다시 작성하려면

curl -k https://<SERVER_ADDR>:443/ -i \ 
    -H "Accept: application/json" \ 
    -H "Content-Type:application/json" \ 
    -X POST -d @${1} https://<SERVER_ADDR>:443/service/ 

이 Curl 스크립트는 작동하지만 다음 루비 스크립트는 작동하지 않습니다.

나는 내가 루비 버전의 컬을 rewrit 수있는 방법을 오류 #<OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A>

header = { 
    "Accept" => " application/json", 
    "Content-Type" => "application/json" 
} 

    resp = RestClient.post(server_url, content, header) 

있어 나머지 클라이언트 라이브러리 https://github.com/rest-client/rest-client

를 사용할 수 있습니까?

답변

1

RestClient는 기본적으로 SSLv3이며, 보안상의 이유로 사용해서는 안됩니다. 조금 더 현대적인 뭔가 변경하려면 :

RestClient::Resource.new('https://<SERVER_ADDRESS>:443/service', :ssl_version => 'TLSv1').post(:json_key => "json_value") 
+0

감사하지만 나는이 어디 GitHub의에 read.me..https에 설명 참조 해달라고 : //github.com/rest-client/rest-client 확실 그것의 유효? – bjm88

관련 문제