decrypting SOCKS proxy

sockhole: Give this a chance of working on Linux

+16 -2
+16 -2
sockhole.rb
··· 96 96 97 97 def post_init 98 98 if tls 99 - start_tls(:verify_peer => true, :cert_chain_file => "/etc/ssl/cert.pem") 99 + start_tls(:verify_peer => true, :cert_chain_file => ssl_cert_chain_file) 100 100 end 101 101 end 102 102 ··· 161 161 log :info, "failed connecting to remote" 162 162 client.send_reply REPLY_FAIL 163 163 end 164 + end 165 + 166 + private 167 + def ssl_cert_chain_file 168 + [ "/etc/ssl/cert.pem", "/etc/ssl/certs/ca-certificates.crt" ].each do |f| 169 + if File.exists?(f) 170 + return f 171 + end 172 + end 173 + 174 + nil 164 175 end 165 176 end 166 177 ··· 375 386 end 376 387 end 377 388 378 - EM.kqueue = true 389 + if RUBY_PLATFORM.match(/bsd/i) 390 + EM.kqueue = true 391 + end 392 + 379 393 EM.run do 380 394 EM.start_server(LISTEN_IP, LISTEN_PORT, EMSOCKS5Connection) 381 395 LOGGER.info "[server] listening on #{LISTEN_IP}:#{LISTEN_PORT}"