- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我有以下 Controller - courses-controller.rb:
class CoursesController < ApplicationController
def index
@search_term = params[:looking_for] || 'jhu'
@courses = Coursera.for(@search_term)
end
end
以下模型 - coursera.rb:
class Coursera
include HTTParty
base_uri 'https://api.coursera.org/api/catalog.v1/courses'
default_params fields: "smallIcon,shortDescription", q: "search"
format :json
def self.for term
get("", query: { query: term})["elements"]
end
end
然后查看 index.html.erb:
<h1>Searching for - <%= @search_term %></h1>
<table border="1">
<tr>
<th>Image</th>
<th>Name</th>
<th>Description</th>
</tr>
<% @courses.each do |course| %>
<tr class=<%= cycle('even', 'odd') %>>
<td><%= image_tag(course["smallIcon"])%></td>
<td><%= course["name"] %></td>
<td><%= course["shortDescription"] %></td>
</tr>
<% end %>
</table>
但是,当我做 http://localhost:3000/courses/index ,我收到以下错误:
SSL_connect returned=1 errno=0 state=SSLv3 读取服务器证书 B:证书验证失败应用跟踪 |框架跟踪 |全迹app/models/coursera.rb:9:in for'
index'
app/controllers/courses_controller.rb:4:in
请告诉我该怎么做。什么都没用!
最佳答案
它看起来像是在提示没有有效的证书?如果是这种情况,您可以告诉 HTTParty 暂时忽略无效证书,如下所示:
class Coursera
include HTTParty
default_options.update(verify: false)
...
如果可行,那么您可能想弄清楚为什么它认为证书无效。
关于html - Ruby on Rails SSL_connect 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36798135/
我使用非阻塞套接字。对于普通的 TCP 连接,我在这里执行: Non blocking socket - how to check if a connection was successful? 但是
我正在尝试使用 SSL 创建服务器-客户端程序。我在使用 SSL_connect() 时遇到了一些麻烦:当我调用它时,它不会再返回,它只是卡在那里,客户端程序一直在运行,服务器停止等待握手完成。一旦我
我目前正在将一些曾经使用 RSA Security 库的现有技术重写到 OpenSSL 中,但我开始遇到一些问题。目前,所有证书验证代码似乎都在顺利运行,直到我调用 SSL_connect()。 之前
这两天,当我尝试安装新的 gem 时,我的控制台上收到了这个错误: Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 sta
我正在尝试通过 TLSv1.2 建立 https 连接。上下文创建和一切都很好,我没有包含在下面的代码中。 if(https) //block 1 { int ssl_err = 0;
我在使用 openssl 库时遇到问题。我在发送 EHLO 和 STARTTLS 后调用以下函数: SSL_CTX *ctx = NULL; SSL *ssl = NULL; void Cre
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and t
我有一个非阻塞套接字,我正在使用 openssl 创建一个 ssl 连接。我的问题是 SSL_connect 的工作方式。在这些情况下,它返回 SSL_ERROR_WANT_READ 或 SSL_ER
你好,我有一个使用 openssl 和 winapi 套接字的 C++ 应用程序,代码如下所示: sock = socket(AF_INET, SOCK_STREAM, 0); if (con
SSL_connect() 是否支持 ssl v3?我问这个的原因是,在访问网站时: https://secure53.onlineaccess1.com 我得到 SSL_connect(ssl) 的
我们有基于 Cucumber 的 UI 自动化测试框架。最近我们已经从 Ruby 1.9.x 迁移到 2.2.0,之后我们在通过测试框架登录我们的应用程序时遇到了问题。它说 SSL 连接重置问题。 错
我刚刚开始学习 C 的 openssl。我在弄清楚 SSL_set_connect_state 之间的区别时遇到了一些麻烦。函数和 SSL_connect功能,因为他们似乎在我的系统上做同样的事情。有
几天来,我一直在努力解决这个问题,想弄清楚它们是如何工作的。我已经阅读了文档并查看了一些示例,但我仍然需要指导。 具体来说,当客户端调用 connect() 并成功连接到服务器主机时,我是否应该在它之
使用我的 SSLCLIENT 的 openssl SSLConnect 出现奇怪的连接失败。 我们正在尝试与服务器建立 ssl 连接。我们注意到 SSL_CONNECT 失败,错误代码为“SSL_ER
当用 openssl 编写的服务器不调用 SSL_accept 时,客户端的 SSL_connect 将永远阻塞。openssl -SSL_CTX_set_timeout 、 SSL_SESSION_
SSL_CTX_set_verify() 和 SSL_set_verify() 调用可用于为底层上下文和 ssl 设置 verify_callback() 函数,分别。以下是 verify_callb
以下代码将始终以 # 结尾错误信息。 它可能会在 5 秒后或 30 分钟后失败。 require 'net/https' http = Net::HTTP.new('newproduct.zendes
我有以下 Controller - courses-controller.rb: class CoursesController Searching for - Imag
我有以下代码,并且我收到了 SIGSEGV: if ( SSL_connect(ssl) == FAIL ) 我遇到的错误是: Program received signal SIGSEGV, Seg
我想在我的 C++ 服务器和客户端中使用 thrift 提供的 ssl 支持。我自己的 Thrift 客户端在通过“transport->open()”后总是卡在 SSL_connect 中.所以我建
我是一名优秀的程序员,十分优秀!