由于OpenSSL + Apache,我正在失去主意。 我查了很多资源,咨询过的同事,意识到现在最好的select是咨询其他资源(也就是你们)。
我使用Python和CherryPy编写了软件,在端口1240上查找HTTP请求。 但是,由于我需要屏蔽networking检查的事实,我想用ssl来包装。 我们决定使用Apache的ProxyPass来代替Python,因为它更快,更可靠,更全球化。
一切都说完成,安装了apache。 build立一个单独的用户等服务运行,所以当它得到(cr / h)acked他们被监禁在一个用户帐户。 所有的爵士乐。
现在我写了以下启用的网站:
ProxyRequests Off <VirtualHost *:443> ServerName SERVER_NAME ProxyPass / http://127.0.0.1:1240/ ProxyPassReverse / http://127.0.0.1:1240/ <Directory proxy:*> Order Deny,Allow Allow from all </Directory> SSLEngine on SSLCACertificateFile /etc/ssl/certs/MY_CERT.crt SSLCertificateFile /etc/ssl/certs/MY_CERT.crt SSLCertificateKeyFile /etc/ssl/certs/MY_CERT.pem </VirtualHost>
看起来棒极了,不是吗(请注意,由于Dataleakage我已经更改了服务器名称和证书的名称大写字母等无论如何,即使是艰难的,看起来不错,当我连接到Firefox我得到以下错误。
(Error code: ssl_error_rx_record_too_long)我想:“等等,那不好”。
所以我开始使用Google,我发现mod-ssl可能不会被加载。 所以我这样检查:
root@SYSTEM:/etc/apache2# apachectl -t -D DUMP_MODULES [Thu Jan 24 09:36:44 2013] [warn] NameVirtualHost *:8080 has no VirtualHosts Loaded Modules: core_module (static) log_config_module (static) logio_module (static) mpm_prefork_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) mime_module (shared) negotiation_module (shared) php5_module (shared) proxy_module (shared) proxy_ajp_module (shared) proxy_balancer_module (shared) proxy_connect_module (shared) proxy_ftp_module (shared) proxy_http_module (shared) proxy_scgi_module (shared) reqtimeout_module (shared) setenvif_module (shared) ssl_module (shared) status_module (shared) Syntax OK
看起来不错,继续前进。 检查日志我发现在这里完全相同的错误: http : //ubuntuforums.org/showthread.php?t=806884
试过了,没有工作。 我重新生成了密钥,但同样的问题( http://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php )我用openssl检查了密钥的有效性:
root@SYSTEM:/etc/ssl/certs# openssl x509 -in MY_CERT.crt -noout -text Certificate: Data: Version: 1 (0x0) Serial Number: <---8<---snip---8<--->(0x<---8<---snip---8<--->) Signature Algorithm: sha1WithRSAEncryption Issuer: <---8<---snip---8<---> Validity Not Before: Jan 24 08:05:44 2013 GMT Not After : Mar 25 08:05:44 2013 GMT Subject: <---8<---snip---8<---> Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (1024 bit) Modulus: <---8<---snip---8<---> Exponent: <---8<---snip---8<---> (0x<---8<---snip---8<--->) Signature Algorithm: sha1WithRSAEncryption <---8<---snip---8<--->
看起来有效,现在我开始失去理智。 另外当我在443 telnet。而我GET /我得到HTML返回。 所以看起来像SSL没有运行。 任何提示/技巧,我尝试? 文件审查或任何?
而且,我认识到自签名等并不是那里最安全的事情。 但那不是现在这个观点,因为它现在只是一个“概念validation”(Proof-of-Concept)。 所以,任何build议将是非常有用的,我会奖励你的ServerFault +1发布thingys之一;)
编辑:另一个小注,当我使用links https://localhost它的作品。
STOLAS@SYSTEM:~$ sudo apachectl -S [sudo] password for STOLAS: [Thu Jan 24 10:47:42 2013] [warn] NameVirtualHost *:8080 has no VirtualHosts VirtualHost configuration: wildcard NameVirtualHosts and default servers: *:443 SERVER.COM (/etc/apache2/sites-enabled/000-default:2) Syntax OK
当@ al4发布的最后一个回复我开始思考。 由于我不是唯一一个在这个问题上工作的人,我决定做一个猫$ HISTFILE有人包括一个iptables规则..
所以,谢谢大家。 对不起浪费你的时间。 事实certificate,我做的一切正确与Apache的东西。 但有人用iptables搞砸我的一天(这花了我2天..)
但是当我做iptables -L ; iptables -t nat -L iptables -L ; iptables -t nat -L (将我的iptables规则转储到标准输出)我发现有一个从143到本地1240的NATTING规则。其他命令让我意识到了iptables,其中netstat -lanp用于检查Apache是否运行而tcpdump not tcp 22用于检查发送到盒子的连接。
感谢您的帮助,我希望失落的Google员工能够在将来find这个有用的答案!