首页 \ 问答 \ 卷曲错误60,SSL证书问题:证书链中的自签名证书(Curl error 60, SSL certificate issue: self signed certificate in certificate chain)

卷曲错误60,SSL证书问题:证书链中的自签名证书(Curl error 60, SSL certificate issue: self signed certificate in certificate chain)

我尝试使用正确的APP_ID,APP_SECRET等向curl发送curl请求

  https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a&redirect_uri=REDIRECT_URI 

我需要从它获取access_token,但是得到一个FALSE和curl_error()否则打印下一条消息:

60: SSL certificate problem: self signed certificate in certificate chain

我的代码是:

    // create curl resource
    $ch = curl_init();

    // set url
    curl_setopt($ch, CURLOPT_URL, $url);
    //return the transfer as a string
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // $output contains the output string
    $output = curl_exec($ch);
    if ( ! $output) {
        print curl_errno($ch) .': '. curl_error($ch);
    }

    // close curl resource to free up system resources
    curl_close($ch);

    return $output;

当我手动移动到上面的链接时,我得到了access_token。 为什么它不适用于卷曲? 请帮助。


I try to send curl request with my correct APP_ID, APP_SECRET etc. to the

  https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a&redirect_uri=REDIRECT_URI 

I need to get access_token from it, but get a FALSE and curl_error() print next message otherwise:

60: SSL certificate problem: self signed certificate in certificate chain

My code is:

    // create curl resource
    $ch = curl_init();

    // set url
    curl_setopt($ch, CURLOPT_URL, $url);
    //return the transfer as a string
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // $output contains the output string
    $output = curl_exec($ch);
    if ( ! $output) {
        print curl_errno($ch) .': '. curl_error($ch);
    }

    // close curl resource to free up system resources
    curl_close($ch);

    return $output;

When I move manually to the link above, I get access_token well. Why it doesn't work with curl? Help, please.


原文:https://stackoverflow.com/questions/21187946
更新时间:2023-06-09 14:06

最满意答案

感谢所有意见和答案!

现在,2014年,我的帖子(2012年5月17日)超过了1.5年,现在是巩固的时候:对我来说,没有任何答案是“完整答案”,但所有答案(参见Nenotlep's和Alex's)图片。 我现在要巩固的主要动机是2013-11的@ mzjn的新闻(这里)

XSL-FO正式临死

在星期六,2013-11-02, Liam RE Quin 写道“我们已经关闭了工作组,因为没有足够的人参与” ,W3C XML活动负责人,关于XSL-FO 2.0连续性的失败。 ( 在这里看到一个更好的副本 )。

工作草案的最新更新是在2012年1月,现在得到证实: W3C将停止开发XSL-2

为什么? 它将被CSS3页面取代,见下文。

PS:讨论“官方声明”,使用https://stackoverflow.com/a/21345449/287948

CSS3正式成长

标准的CSS3页面是一个草稿,但许多应用程序,如PrinceXML v9AntennaHouse Formatter v6都证明它已经准备就绪(!); 并且, 2014年预计推出的HTML5正在推出预测版本CSS3。

所以,我明白对于W3C而言, CSS3页面会尽我们所需表达良好的印刷品和良好的PDF

其他动机

有一天,在遥远的将来...... PDF将会死去 - 它很复杂,不属于XML家族或W3C投资的一部分,并且许多人声称EPUB将取代它。 这是另一个好的动机:平板电脑阅读器和PC浏览器将打印(HTML,XHTML和EPUB)以及PDF。 因此,PDF将不是必要的...而且,为了这一天,唯一的标准需要,例如。 Webkit打印项目将成为CSS3页面标准。

CSS3是两个战略事务中的关键:1)从XML或HTML内容生成良好的PDF; 2)取代PDF。


注意:另一个2014年更新的问题链接: wkHtmlToPDF现在在这里 。 关于“新文本”,现在我们有很多,见前。 使用CSS3构建书籍



对于本页面的问题, 为什么使用XSL-FO而不是CSS2将程序员的HTML转换为良好的PDF?

如果您进一步实施XML发布的新系统, 则没有充分的理由使用XSL-FO 。 总结:

  • XSL-FO目前是一种死亡技术,只能由小众公司使用,才能维护Elsevier等大型出版公司的遗留系统......大多数Stackoverflow的作者/读者都来自中小型公司。 O'Reilly Media,Inc.等公司已经在使用CSS3进行打印

  • CSS3将取代CSS2,覆盖CSS2的所有差距(以及AlexS的恐惧)。

  • 今天(2014),您可以通过Google或我的链接进行检查(请参阅PrinceXML v9和AntennaHouse Formatter v6),我们有一些用CSS2CSS3呈现内容的好软件。

  • 正如@bytebuster所说:“CSS开发起来容易得多”(并且更容易学习!)。

  • 正如我上面所说的,CSS3并不是孤立的,它是“XML / HTML / SVG”系列中的一部分。

  • 比“XSL-FO模板”(复杂任务中少有的专业人员的小时成本)开发“HTML + CSS模板”(每小时执行一项简单任务的标准网页设计师的成本)便宜得多。

  • ....



新闻...

2016年1月,最终的CSS3标准即将到来!

关于W3C标准:旧的“css-page”已被“css-break”“分页媒体 所取代,成为“碎片化” ......现在是候选推荐标准,请参阅https://www.w3.org/ TR / CSS-突破3


Thanks all comments and answers!

Now, 2014, passed over 1.5 years of my post (May 17 '12), is time to consolidate: no answer was, for me, a "full answer", but all answers (see Nenotlep's and Alex's) contributed to form a big picture. My main motivation now, to consolidate, is the @mzjn's news (here) of 2013-11.

XSL-FO is officially dying

On Sat, 2013-11-02, Liam R. E. Quin wrote: "We have closed the Working Group because not enough people were taking part", W3C XML Activity Lead, about the failure of XSL-FO 2.0 continuity. (see a better copy here).

The last update for the Working Draft was in January 2012, and now confirmed: W3C stop developing XSL-2.

Why? It will be replaced by CSS3-page, see below.

PS: to discuss the "official statment", use https://stackoverflow.com/a/21345449/287948

CSS3 is officially growing

The standard CSS3-page is a draft, but many applications, like PrinceXML v9 and AntennaHouse Formatter v6 demonstrated that it is ready (!); and, the expected launch of HTML5 for 2014 is carrying along the forecast release CSS3.

So, I understand that for W3C, CSS3-page do all that we need to express good prints and good PDF.

Other motivations

One day, in a far future... PDF will dead — it is complex and is not part of the XML family or W3C investments —, and many claim that EPUB will replace it. This is another good motivation: tablet readers and PC browsers will print (HTML, XHTML and EPUB) as well as PDF. So PDF will be not necessary... And, for this day, the only standard need for, ex. Webkit printing project, will be the CSS3-page standard.

CSS3 is the key point in two strategic affairs: 1) to generate good PDF from XML or HTML contents; 2) to replace PDF.


NOTE: another 2014's updates for the links of the question: wkHtmlToPDF is now here. About "new texts", now we have many, see ex. Building Books with CSS3.



An updated answer for programmers, for this page's question, Why use XSL-FO instead of CSS2, for transform HTML into good PDF?

If you go further and implement a new system for XML-Publishing, there are no good reason to use XSL-FO. SUMMARIZING:

  • XSL-FO is a dead technology today, only used by niche companies, to give maintenance to legacy systems in big publishing companies, like Elsevier... Most writers/readers of Stackoverflow are from small and medium companies. Companies like O'Reilly Media, Inc. already use CSS3 for print.

  • CSS3 will replace CSS2, covering all gaps (and fears as @AlexS's) of CSS2.

  • today (2014), as you can check by Google or my links (see PrinceXML v9 and AntennaHouse Formatter v6), we have some good software to render content with CSS2 or CSS3.

  • as @bytebuster say, "CSS is much easier to develop" (and easier to learn!).

  • as I say above, CSS3 is not isolated, it is a piece of the "XML/HTML/SVG" family.

  • is much cheaper to develop "HTML+CSS templates" (hourly cost of a standard web designer doing a simple task), than "XSL-FO templates" (hourly cost of a rare professional in a complex task).

  • ....



News...

Jan'2016, the definitive CSS3 standard is coming!

About W3C standards: the old "css-page" was replaced by "css-break", and "paged media" to "fragmentation"... Now it is a Candidate Recommendation, see https://www.w3.org/TR/css-break-3

相关问答

更多
  • 感谢所有意见和答案! 现在,2014年,我的帖子(2012年5月17日)超过了1.5年,现在是巩固的时候:对我来说,没有任何答案是“完整答案”,但所有答案(参见Nenotlep's和Alex's)图片。 我现在要巩固的主要动机是2013-11的@ mzjn的新闻(这里) 。 XSL-FO正式临死 在星期六,2013-11-02, Liam RE Quin 写道 : “我们已经关闭了工作组,因为没有足够的人参与” ,W3C XML活动负责人,关于XSL-FO 2.0连续性的失败。 ( 在这里看到一个更好的副本 ...
  • XSL-FO仅用于PDF显示(这不完全正确,但您可以将其作为指导原则)。 所以HTML输出和FO输出不相关。 从您的XML源代码,您可以使用XSLT生成XHTML 或 XSL-FO,但不能同时生成XHTML 或 XSL-FO。 例如参见DocBook。 它带有几个准备使用的XSLT样式表,一个用于HTML输出,另一个用于PDF(通过Apache Fop)。 如果你对结果感到满意可能是一个不同的问题。 XSL-FO is for PDF display only (this is not strictly t ...
  • 似乎没有正确设置FOP的配置。 编辑或复制您在FOP安装目录的conf文件夹中找到的文件fop.xconf 。 在此文件中,找到标记。 在子标记内,添加 。 您应该获得这样的配置(我已删除所有注释文本):