LoginSignup
4
6

More than 3 years have passed since last update.

SSLHでSoftether(SSTP)とApacheを共存

Posted at

SSLHでSoftether(SSTP)とApacheを共存

 443番ポートへのアクセスをプロトコルによって判別して、複数のサービスに振り分けることで443番を共有可能にする手段としてSSLH(https://github.com/yrutschle/sslh) がありますが、対応しているVPNプロトコルはOpenVPNのみです。
 Sofetherの独自プロトコルやSSTPプロトコルをSSLHのバックで使用する設定を模索して、ベターではありますが動作しましたので記載します。

SSLHのヘルプ

sslh -h
sslh 1.18-1
usage:
        sslh  [-v] [-i] [-V] [-f] [-n] [--transparent] [-F <file>]
        [-t <timeout>] [-P <pidfile>] -u <username> -p <add> [-p <addr> ...]
        [--ssh <addr>]
        [--openvpn <addr>]
        [--tinc <addr>]
        [--xmpp <addr>]
        [--http <addr>]
        [--ssl <addr>]
        [--tls <addr>]
        [--adb <addr>]
        [--anyprot <addr>]
        [--on-timeout <addr>]

設定は下記のように各サービスサーバのIPを --ssh hogehoge.com の形で列挙していきますが、この中に --anyprot として指定したポートにはSSLHが対応していないプロトコルのパケットが全て転送されます。

ここにSoftetherの待ち受けポートを記載することでSoftetherの対応する全てのVPNプロトコルがSSLHのバックで使用可能になりました。

sudo nano /etc/default/sslh

RUN=yes

# binary to use: forked (sslh) or single-thread (sslh-select) version
# systemd users: don't forget to modify /lib/systemd/system/sslh.service
DAEMON=/usr/sbin/sslh

#softetherのポート:8080 (localhost)
DAEMON_OPTS="--user sslh --listen 192.168.1.1:443 --anyprot 127.0.0.1:8080 --ssl 127.0.0.1:8443...

SSLHのソースに、その他のプロトコルの判別ルールを追記するのがベストですがそのような知識が現状ありませんので取り急ぎの手段としては使えるかなとは思います。

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6