- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我查看了 STACKOVERFLOW 上列出的每个解决方案。没有什么能解决这个问题。我遇到的问题仅在我将端口(在此示例中为 5443)附加到 cURL PHP 代码时出现。如果我在没有端口的情况下执行 CLI,它就可以工作。在代码中,如果我只做一个直接的 URL https://HOSTNAME/api/test无需分配端口,它就可以工作。无论哪种方式,我都可以看到 GET 进来。这都是关于认证验证的。该端口在服务器上打开。
我有 GoDaddy G2 证书。我有一个带有 CA bundle 的新建服务器,我尝试使用根证书,来自
的证书 bundle"https://curl.haxx.se/docs/caextract.html"
以及所有其他组合。添加端口号时总是出现相同的错误:
“SSL 证书问题:无法获取本地颁发者证书”
$url = "https://HOSTNAME/api/test";
$curl = curl_init();
if ($curl === false)
{
echo "Failure";
} else
{
curl_setopt($curl, CURLOPT_PORT, 5443);
curl_setopt($curl, CURLOPT_HTTPGET, true);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Turn on SSL certificate verification
curl_setopt($curl, CURLOPT_CAPATH, "/fully_resolved_path/");
// and tried this way too
curl_setopt($curl, CURLOPT_CAPATH, "/fully_resolved_path");
//试过了
curl_setopt($curl,CURLOPT_CAINFO,"/fully_resolved_path/cacert.pem");
//这实际上是默认设置,不再支持1,对本例的最终结果没有影响。
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
//为 TRUE 时失败! FALSE 时不执行检查
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);
$result = curl_exec($curl);
if ($result === false)
{
echo curl_error($curl);
} else
{
echo $result;
}
curl_close($curl);
一切都已设置并按预期工作,返回一个 JSON 对象。只有当我添加端口号时,它才会阻塞。 SSL 证书中的通用名称与 HOSTNAME 匹配。如前所述,在我添加端口号之前它一直有效。
最佳答案
I have looked at every solution listed on STACKOVERFLOW. Nothing resolves this issue.
哇。但不幸的是,这个“信息”是无用的,因为它没有说明您实际尝试过的任何内容。
The issue I am having is only when I attach a port, in this example 5443, to the cURL PHP code. If I do a CLI without the port it works.
这是因为如果没有端口,它将使用端口 443。由于您显式使用端口 5443,您连接到具有不同设置的不同服务器,并且与端口 443 上的证书相比,它提供不同的证书。只需尝试将端口显式设置为443,您会发现它有效。
很可能端口 5443 上的服务器正在提供一些自签名证书、一些由某个未知 CA 颁发的证书或缺少必要的链证书(即配置错误)。这些是通常与此类错误相关的原因,您应该已经看到了这一点并且还看到了解决方案,因为您“查看了 STACKOVERFLOW 上列出的每个解决方案”。请记住,要修复您需要查看端口 5443 的服务器而不是端口 443 的默认服务器。
关于PHP curl 错误 : SSL certificate problem: unable to get local issuer certificate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57049205/
我很绝望,现在已经两天(!!)天都没有解决方案来解决以下问题。 更新 Lion 后,我想使用最新版本的 rvm 安装额外的 rubies。 这是我之后调用 bundler 时发生的情况: /Users
我的问题: ajax 调用的无限循环会产生问题吗? 假设有这样的代码: ajaxcall(); function ajaxcall(){ jQuery.ajax({ typ
这是一个有趣的小项目,我已经开始尝试并最大限度地提高赢得办公室曲棍球池的机会。我试图找到最好的方法来选择 20 名能够在最高工资帽内给我最多分数的球员。 例如,假设原始数据由 玩家姓名 位置(前锋,后
我有一个总数为540000的数字列表。我想将此列表分为3个列表,每个列表总共180000。最有效的编程方法是这样做,假设数字列表是一个平面文件,每个数字为线? 最佳答案 听起来像Knapsack pr
抱歉,也许因为我不是英语,我不知道,但我找不到解决几个问题的任何资源;也许我用的词不正确.. 我想了解有关 iPhone 4 和 5 不同分辨率的更多信息。 首先:如果我开发针对 iPhone 4 分
在全局配置缓存后,如 docs ,如果我在 app.module 之外使用 CacheInterceptor,它会抛出错误。 app.module.ts const cacheConfig = {
我无法让 g:each 工作。我正在尝试遍历任何内容,但它永远不起作用 = 不生成任何 html。 索引.gsp Item ${i.name} 用户 Controller .g
在我的 XAML 文件中,我有一个这样声明的 ListBox:
想知道你是否可以帮助我: 我有一个名为initializeAll的方法: public final void initializeAll() { //other stuff........ rand
我尝试过使用 XML 和 JAVA 在我的 Android Activity 中创建一个 ImageView。这两次,我都能够获取我一天前创建的所有其他 PNG 资源以显示在 ImageView 中。
我需要你的帮助。这是什么意思? Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'
这是一段代码 function test() { this.value = "foo"; } $(document).ready(function () { test();
这是一些非常基础的东西。渲染期间引发异常:java.util.Locale.toLanguageTag()Ljava/lang/String; XML: 问题似乎出在 Edit
除其他来源外,我还使用 Stackoverflow 上的各种帖子,尝试实现我自己的 PHP 分类器,以将推文分类为正面、中性和负面类别。在编码之前,我需要弄清楚流程。我的思路和例子如下:
在过去的几周里,每当我在 Eclipse 上使用 SVN 插件时,我都会收到以下错误: Certificate Problem There is a problem with the site's s
我被拒绝运行以下功能(位于 /var/www/mysite/public_html/app/Controllers/Script.php) $structure = '/var/www/mysite/
我正在使用 ctags 为我的 Emacs 创建标签以使用 cygwin 从中读取符号。 Emacs 说 “访问标签表缓冲区:文件/home/superman/tags 不是有效的标签表” 这是我查找
我知道作为一种函数式语言,XSL 没有像传统的 for 循环(而是 for-each)那样的东西。 我正在尝试从可变数量的元素开始创建一个具有固定数量 (7) 的表。总之,我有
我正在使用RavenDB进行一些测试,以基于iphone应用程序存储数据。该应用程序将发送一个带有GPS key 的5个GPS坐标的字符串。我在RavenDB中看到每个文档约为664-668字节。这是
我无法理解我的应用程序的行为。我想创建一个简单的窗口 (1000x700px),分为两部分(分别为 250px 和 750px 宽度)。我尝试了以下代码: import java.awt.Color;
我是一名优秀的程序员,十分优秀!