我正在用omniauth/openid進行一些操作。ruby-openid:執行發現時未設置@socket
當試圖進行身份驗證,我發現這個在我的日誌:
OpenID::FetchingError: Error fetching https://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username: undefined method `io' for nil:NilClass
重要的有undefined method io' for nil:NilClass
它來自的OpenID/fetchers.rb,下面的代碼片段:
module Net
class HTTP
def post_connection_check(hostname)
check_common_name = true
cert = @socket.io.peer_cert
cert.extensions.each { |ext|
next if ext.oid != "subjectAltName"
ext.value.split(/,\s+/).each{ |general_name|
if /\ADNS:(.*)/ =~ general_name
check_common_name = false
...
該錯誤由@socket.io.peer_cert
生成,@socket未定義。
您有沒有遇到過這個?不太確定原因是什麼。
版本我運行:
- 紅寶石1.9.3dev(2010-08-17軀幹29020)[x86_64的-darwin10.4.0]
- 紅寶石的OpenID(2.1.8)
- 紅寶石OpenID的應用發現(1.2.0)
- omniauth 0.2.0