; Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2011
; Some options used here may not be adequate for your particular configuration
; Please read the manual and make sure you understand them
; *****************************************************************************
; * Global Options *
; *****************************************************************************
; *****************************************************************************
; * Service Defaults (may also be specified in individual service sections) *
; *****************************************************************************
; Certificate/key is needed in server mode and optional in client mode
;cert = stunnel.pem
;key = stunnel.pem
; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem
; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS
; The following options provide additional security at some performance penalty
; Default ECDH/DH parameters are strong/conservative, so it is quite safe to
; comment out these lines in order to get a performance boost
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE
; *****************************************************************************
; * Service Definitions (at least one service has to be defined) *
; *****************************************************************************
;[https]
;accept = 443
;connect = 80
; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
; It does not use SSL close-notify alert designed to prevent truncation attacks
;TIMEOUTclose = 0
LedBiffの配布サイトにある説明を参考にインストール後、設定してみてください。
・LedBiffでSSL ~ LedBiffでGMailをチェックするには ~
http://www.ledbiff.org/software/ledbiff/ssl.html
※メール受信を7001ポートに変更して使用する例です。
以下のページも参考になると思います。
・Gmailを非対応メールソフトで読む方法
http://gmail.1o4.jp/stunnel.html
※メール受信標準の110ポートを使用する例です。
「accept=localhost:7001」を「accept=127.0.0.1:7001」(※110ポートを利用する場合は、「accept=localhost:110」を「accept=127.0.0.1:110」)と変更してから確認してみてください。
※設定ファイルの変更後は、stunnelを再起動をするか、タスクトレイのアイコンを右クリック→「Show Log Window」を実行してログウィンドウを表示し、「Configuration」→「Reload stunnel.conf」を実行する必要があります。
※「debug=0」の行は削除するか、あるいは「;debug=0」として無効にして置いた方がいいかもしれません。(ログウィンドウで接続ログを確認できるようになります。)
※「options = NO_SSLv2」を追加しておいた方がいいかもしれません。(デフォルトのstunnel.confでは「Disable support for insecure SSLv2 protocol(安全でないSSLv2プロトコルのサポートを無効にする)」とあり、有効になっています。)
※LedBiffのポート設定は、stuunelの設定ファイルで指定したポート(「accept=127.0.0.1:7001」とした場合は7001)と合わせてください。
一応、以下にデフォルトのstunnel.confの必要な部分だけを有効にした物を載せておきます。(7001番ポートを利用する場合になっています。)
※一部デフォルトでない部分があったので修正して再度コメントしています。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Sample stunnel configuration file for Win32 by Michal Trojnara 2002-2011
; Some options used here may not be adequate for your particular configuration
; Please read the manual and make sure you understand them
; *****************************************************************************
; * Global Options *
; *****************************************************************************
; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log
; *****************************************************************************
; * Service Defaults (may also be specified in individual service sections) *
; *****************************************************************************
; Certificate/key is needed in server mode and optional in client mode
;cert = stunnel.pem
;key = stunnel.pem
; Authentication stuff needs to be configured to prevent MITM attacks
; It is not enabled by default!
;verify = 2
; Don't forget to c_rehash CApath
;CApath = certs
; It's often easier to use CAfile
;CAfile = certs.pem
; Don't forget to c_rehash CRLpath
;CRLpath = crls
; Alternatively CRLfile can be used
;CRLfile = crls.pem
; Disable support for insecure SSLv2 protocol
options = NO_SSLv2
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS
; The following options provide additional security at some performance penalty
; Default ECDH/DH parameters are strong/conservative, so it is quite safe to
; comment out these lines in order to get a performance boost
;options = SINGLE_ECDH_USE
;options = SINGLE_DH_USE
; *****************************************************************************
; * Service Definitions (at least one service has to be defined) *
; *****************************************************************************
; Example SSL server mode services
;[pop3s]
;accept = 995
;connect = 110
;[imaps]
;accept = 993
;connect = 143
;[ssmtp]
;accept = 465
;connect = 25
; Example SSL client mode services
[gmail-pop3]
client = yes
accept = 127.0.0.1:7001
connect = pop.gmail.com:995
;[gmail-imap]
;client = yes
;accept = 127.0.0.1:143
;connect = imap.gmail.com:993
;[gmail-smtp]
;client = yes
;accept = 127.0.0.1:25
;connect = smtp.gmail.com:465
; Example SSL front-end to a web server
;[https]
;accept = 443
;connect = 80
; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
; It does not use SSL close-notify alert designed to prevent truncation attacks
;TIMEOUTclose = 0
; vim:ft=dosini
一度設定が有効になった後で、別のポート番号を試してから元のポート番号に戻す場合、stunnelと通信できなくなります。
元のポート番号に戻したい場合は、別のポート番号を有効にした状態で一度メーラーなどのクライアントソフト(LedBiff)とstunnelを終了してから、再度起動して元のポート番号に指定し直す必要がありました。
※なお、なるべく110ポートを使用するか、あるいは下記のページで「Description」の欄が「Unassigned」となっているポート番号(1024番 - 49151番までの間)を使用するようにした方が良いと思います。(ほとんどのPCでは影響ないと思いますが・・・)
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
できました。