tangled
alpha
login
or
join now
jcs.org
/
sockhole
0
fork
atom
decrypting SOCKS proxy
0
fork
atom
overview
issues
pulls
pipelines
sockhole: Give this a chance of working on Linux
jcs.org
4 years ago
e9a68b79
d4a36463
+16
-2
1 changed file
expand all
collapse all
unified
split
sockhole.rb
+16
-2
sockhole.rb
···
96
96
97
97
def post_init
98
98
if tls
99
99
-
start_tls(:verify_peer => true, :cert_chain_file => "/etc/ssl/cert.pem")
99
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
164
+
end
165
165
+
166
166
+
private
167
167
+
def ssl_cert_chain_file
168
168
+
[ "/etc/ssl/cert.pem", "/etc/ssl/certs/ca-certificates.crt" ].each do |f|
169
169
+
if File.exists?(f)
170
170
+
return f
171
171
+
end
172
172
+
end
173
173
+
174
174
+
nil
164
175
end
165
176
end
166
177
···
375
386
end
376
387
end
377
388
378
378
-
EM.kqueue = true
389
389
+
if RUBY_PLATFORM.match(/bsd/i)
390
390
+
EM.kqueue = true
391
391
+
end
392
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}"