cURL错误:无法连接:SSL已禁用。(cURL Error : Cannot connect: SSL is disabled. Error number 35)
我正在使用Centos 7在Digital Ocean的盒子上托管我的一个应用程序中的paypal ipn脚本。
当我尝试连接到paypal沙箱api时,我收到错误“无法连接:SSL已禁用”。
我已经尝试了几个东西,比如像在我的php.ini文件中添加curl.cainfo的路径
curl.cainfo = /etc/pki/tls/certs/ca-bundle.trust.crt
这是我的cURL脚本的样子
// STEP 2: Post IPN data back to paypal to validate $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); // change to [...]sandbox.paypal[...] when using sandbox to test curl_setopt($ch, CURLOPT_SSLVERSION, 4); curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'ecdhe_rsa_aes_128_gcm_sha_256'); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
我没有太多的Linux服务器设置经验,所以我一直在学习。 任何帮助或指导非常感谢
更新:当我在命令行中运行此命令
curl --version https://sandbox.paypal.com/cgi-bin/webscr
我得到这个错误
curl: (1) Protocol "https" not supported or disabled in libcurl
命令
curl --version
显示curl 7.42.1 (x86_64-unknown-linux-gnu) libcurl/7.46.0
所以我猜测新的问题是如何在libcurl中启用https?
I am working on the paypal ipn script in one of my applications hosted on a Digital Ocean's box with Centos 7.
When i try to connect to the paypal sandbox api i get the error "Cannot connect: SSL is disabled."
I have tried several things like adding the path of the curl.cainfo in my php.ini file like so
curl.cainfo = /etc/pki/tls/certs/ca-bundle.trust.crt
this is what my cURL script looks like
// STEP 2: Post IPN data back to paypal to validate $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); // change to [...]sandbox.paypal[...] when using sandbox to test curl_setopt($ch, CURLOPT_SSLVERSION, 4); curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'ecdhe_rsa_aes_128_gcm_sha_256'); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
I have not got much experience with Linux server setup so I am learning as i go along. Any help or guide is much appreciated
UPDATE : when i run the this command in the command line
curl --version https://sandbox.paypal.com/cgi-bin/webscr
i get this error
curl: (1) Protocol "https" not supported or disabled in libcurl
Also the command
curl --version
displayscurl 7.42.1 (x86_64-unknown-linux-gnu) libcurl/7.46.0
So i am guessing the new question would be how to enable https in libcurl?
原文:https://stackoverflow.com/questions/35083569
最满意答案
从这个答案 :您需要从输出格式中删除
citations
扩展名。pandoc Experimental-notes.md -t markdown-citations -o out.md --bibliography ../allBib.bib
From this answer: you need to remove the
citations
extension from the output format.pandoc Experimental-notes.md -t markdown-citations -o out.md --bibliography ../allBib.bib
相关问答
更多-
这里有一个使用LaTeX代码的例子。 您需要在R markdown文件的相同文件夹中有一个单独的样式文件,您可以在其中定义字体系列。 在样式文件(mystyle.sty)中,您可以定义LaTeX字体目录中的任何字体,例如Palatino Sans Serif: \usepackage{palatino} \renewcommand{\familydefault}{\sfdefault} % sans serif \fontfamily{ppl}\selectfont 有关通过LaTeX使用Tahoma的方 ...
-
reftex-default-bibliography的docstring的reftex-default-bibliography说: BibTeX数据库文件列表,如果没有指定,应该使用它们。 换句话说,它看起来像是在期待一个列表,所以你需要将你的文件括在括号中,使它成为一个元素的列表: %%% Local Variables: %%% reftex-default-bibliography: ("~/texmf/tex/latex/demo2LatexEmacs/mini.bib") %%% End: ...
-
如果您想将书目风格设置为使用bst文件,则需要强制R Markdown将natbib或biblatex用作引文管理器。 默认情况下,它将使用pandoc来构建引用。 这篇文章解释了更多的行为。 其次,一旦你有这个工作,你需要改变文件的引用风格。 默认情况下,natbib将使用作者年度引用,但您提供的bst文件不适用于这些引用。 所以我将引文样式改为数字。 下面是一个简单的例子。 它将创建一个书目文件test.bib但您需要确保alphadin.bst文件位于同一个目录中。 --- output: pd ...
-
尝试使用 \bibliographystyle{unsrt} \bibliography{your_bib_file_without_extension} unsrt选项会按照它们在文本中出现的顺序对它们进行unsrt 。 Try using \bibliographystyle{unsrt} \bibliography{your_bib_file_without_extension} The unsrt option orders the references as they appear in te ...
-
.bib文件中的knitr块(knitr chunks within .bib file)[2023-09-02]
您必须首先编织.bib文件 ,然后运行LaTeX和BibTeX。 虽然你通常有一个.Rnw编织的.Rnw文件,然后让LaTeX工具处理.tex和.bib文件,你必须从一个(让我们称之为) .Rbib文件开始,该文件被编织为.bib和然后由LaTeX处理。 为简单起见,我将名为.Rbib的文件名为.Rbib ,但您可以选择任何您喜欢的扩展名。 我选择了.Rnw因为里面使用的语法与.Rnw文件中的语法相同。 作为bib文件的虚拟条目,我使用来自verbosus.com的数据并添加了一些knitr代码。 第一个块 ... -
您可以使用pandoc手册中的这个技巧 ,相当于biblatex的\nocite{*} : 通过使用通配符,可以创建包含所有引文的参考书目,无论它们是否出现在文档中: --- nocite: | @* --- You could use this trick from the pandoc's manual, the equivalent of biblatex's \nocite{*}: It is possible to create a bibliography with all the cit ...
-
从这个答案 :您需要从输出格式中删除citations扩展名。 pandoc Experimental-notes.md -t markdown-citations -o out.md --bibliography ../allBib.bib From this answer: you need to remove the citations extension from the output format. pandoc Experimental-notes.md -t markdown-citati ...
-
您可以通过将其类设置为allowframebreaks来allowframebreaks在下一个幻灯片上继续幻灯片。 就这样做你的最后一张幻灯片。 从pandoc 邮件列表 : ## References {.allowframebreaks} 编辑: knitr有一个设置,可以防止此解决方案使用rmarkdown开箱即用。 请参阅此问题以获得解决方案。 You can force a slide to be continued on the next one by setting its class ...
-
和Dirk一样,它对我有用。 也许你没有正确地把YAML放在一起,或者你从来没有引用任何东西。 这是一个适用于您的bib文件的示例文档: --- title: "Biblio Example" output: html_document bibliography: bibliography.bib --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Here's Some Text This text ci ...
-
我从http://www.zotero.org/styles下载了'elsevier-harvard.csl'引文样式 我打开了http://editor.citationstyles.org/visualEditor/并加载了提到的样式 在参考书目布局下,我添加了节点'文字',设置类型:'变量'和选择变量'注意' 我更改了样式的名称,然后下载了它(elsevier-harvard-with-titles-with-notes.csl) 在我的.Rmd文件的标题内,我添加了以下行: csl: elsevie ...