gpt4 book ai didi

apache - SSL 错误 Zend Framework BoxAPI

转载 作者:太空宇宙 更新时间:2023-11-03 15:01:21 25 4
gpt4 key购买 nike

我在连接到 Oauth2 API 时遇到问题,它需要 HTTPS 连接。所以我正在尝试在我的服务器 (apache2) 上配置 ssl 以提供我提供给 Box-API 的回调地址,这是一个 https 地址。

但我一直收到这个错误:

 (Codice di errore: ssl_error_rx_record_too_long)

所以我搜索了网络,发现我必须在我的服务器上设置 ssl_mod。但是当我在文件中写入 LoadModule 行并重新启动服务器时,它说该模块已经内置,所以我查看了配置。 Httpd.conf 有这些行:

 <IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
Listen 443
</IfModule>
[...]
<VirtualHost *:443>
ServerName localhost
SSLProxyEngine on
SSLEngine on
SSLCertificateFile /usr/local/zend/apache2/server.crt
SSLCertificateKeyFile /usr/local/zend/apache2/host.nopass.key
</VirtualHost>

除 httpd-ssl.conf 外还有以下内容:

 #SSLRandomSeed startup file:/dev/random  512
#SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/random 512
#SSLRandomSeed connect file:/dev/urandom 512
[...]
Listen *:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl

SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/usr/local/zend/apache2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "file:/usr/local/zend/apache2/logs/ssl_mutex"

<VirtualHost _default_:443>

# General setup for the virtual host
DocumentRoot "/usr/local/zend/apache2/htdocs"
ServerName localhost:443
ServerAdmin
ErrorLog "/usr/local/zend/apache2/logs/error_log"
TransferLog "/usr/local/zend/apache2/logs/access_log"
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/usr/local/zend/apache2/server.crt"
#SSLCertificateFile "/usr/local/zend/apache2/conf/server-dsa.crt"

SSLCertificateKeyFile "/usr/local/zend/apache2/host.nopass.key"
#SSLCertificateKeyFile "/usr/local/zend/apache2/conf/server-dsa.key"

#SSLCertificateChainFile "/usr/local/zend/apache2/conf/server-ca.crt"
#SSLCACertificatePath "/usr/local/zend/apache2/conf/ssl.crt"
#SSLCACertificateFile "/usr/local/zend/apache2/conf/ssl.crt/ca-bundle.crt"
#SSLCARevocationPath "/usr/local/zend/apache2/conf/ssl.crl"
#SSLCARevocationFile "/usr/local/zend/apache2/conf/ssl.crl/ca-bundle.crl"
#SSLVerifyClient require
#SSLVerifyDepth 10
#<Location />
#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#</Location>
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/zend/apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

CustomLog "/usr/local/zend/apache2/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

我做了 a post在 ZendForum 中也是如此。

更新:问题可能不在 apache 配置中,而是在浏览器中,我发现网上有很多人说这是浏览器配置错误。现在,如果我导航到:

 https://localhost 

我得到了页面的内容,但是如果我尝试连接外部服务(比如我必须使用的 api),错误仍然存​​在。我正在检查日志。

最佳答案

答案并不简单。但是我不得不更改证书并将 CommonName 设置为本地主机。然后在 httpd-ssl.conf 中,我必须将虚拟主机设置为使用 10088 端口,而不是 443,因为我必须在该端口上创建 https 的 URL,所以我必须在 ssl 上激活正确的虚拟主机才能获得它工作。这是我的 2 美分...

关于apache - SSL 错误 Zend Framework BoxAPI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21331577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com