diff options
author | Ingela Anderton Andin <[email protected]> | 2010-09-22 13:56:31 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2010-09-24 15:43:34 +0200 |
commit | 266ea3592e49cc93e69735eea4572e95fedc6a19 (patch) | |
tree | 79087cd024f9f33563496e61579264c64d031dc6 /lib/ssl/src/ssl.erl | |
parent | 17224a3d31d25ce6daa4de63b52b26bee9564bcd (diff) | |
download | otp-266ea3592e49cc93e69735eea4572e95fedc6a19.tar.gz otp-266ea3592e49cc93e69735eea4572e95fedc6a19.tar.bz2 otp-266ea3592e49cc93e69735eea4572e95fedc6a19.zip |
Backwards compatibility
Changed implementation to retain backwards compatibility for old
option {verify, 0} that shall be equivalent to {verify, verify_none},
also separate the cases unknown CA and selfsigned peer cert, and
restored return value of deprecated function public_key:pem_to_der/1.
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r-- | lib/ssl/src/ssl.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 12dffb413c..8730cad127 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -529,17 +529,17 @@ handle_options(Opts0, _Role) -> ReuseSessionFun = fun(_, _, _, _) -> true end, - VerifyNoneFun = - {fun(_,{bad_cert, unknown_ca}, UserState) -> + DefaultVerifyNoneFun = + {fun(_,{bad_cert, _}, UserState) -> {valid, UserState}; - (_,{bad_cert, _} = Reason, _) -> - {fail, Reason}; (_,{extension, _}, UserState) -> {unknown, UserState}; (_, valid, UserState) -> {valid, UserState} end, []}, + VerifyNoneFun = handle_option(verify_fun, Opts, DefaultVerifyNoneFun), + UserFailIfNoPeerCert = handle_option(fail_if_no_peer_cert, Opts, false), UserVerifyFun = handle_option(verify_fun, Opts, undefined), CaCerts = handle_option(cacerts, Opts, undefined), |