diff options
Diffstat (limited to 'lib/ssl')
-rw-r--r-- | lib/ssl/src/ssl_session_cache.erl | 2 | ||||
-rw-r--r-- | lib/ssl/test/ssl_session_cache_SUITE.erl | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/lib/ssl/src/ssl_session_cache.erl b/lib/ssl/src/ssl_session_cache.erl index ae7c67bb98..c1be6691be 100644 --- a/lib/ssl/src/ssl_session_cache.erl +++ b/lib/ssl/src/ssl_session_cache.erl @@ -36,7 +36,7 @@ %% Description: Return table reference. Called by ssl_manager process. %%-------------------------------------------------------------------- init(_) -> - ets:new(cache_name(), [named_table, set, protected]). + ets:new(cache_name(), [set, protected]). %%-------------------------------------------------------------------- -spec terminate(cache_ref()) -> any(). %% diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index 3ec887f165..5d96b457ed 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -207,9 +207,14 @@ session_cleanup(Config)when is_list(Config) -> %% Make sure session is registered test_server:sleep(?SLEEP), + {status, _, _, StatusInfo} = sys:get_status(whereis(ssl_manager)), + [_, _,_, _, Prop] = StatusInfo, + State = state(Prop), + Cache = element(2, State), + Id = proplists:get_value(session_id, SessionInfo), - CSession = ssl_session_cache:lookup(ssl_otp_session_cache, {{Hostname, Port}, Id}), - SSession = ssl_session_cache:lookup(ssl_otp_session_cache, {Port, Id}), + CSession = ssl_session_cache:lookup(Cache, {{Hostname, Port}, Id}), + SSession = ssl_session_cache:lookup(Cache, {Port, Id}), true = CSession =/= undefined, true = SSession =/= undefined, @@ -218,13 +223,18 @@ session_cleanup(Config)when is_list(Config) -> test_server:sleep(5000), %% Expire time test_server:sleep((?SLEEP*20), %% Clean up delay (very small in this test case) + some extra time - undefined = ssl_session_cache:lookup(ssl_otp_session_cache, {{Hostname, Port}, Id}), - undefined = ssl_session_cache:lookup(ssl_otp_session_cache, {Port, Id}), + undefined = ssl_session_cache:lookup(Cache, {{Hostname, Port}, Id}), + undefined = ssl_session_cache:lookup(Cache, {Port, Id}), process_flag(trap_exit, false), ssl_test_lib:close(Server), ssl_test_lib:close(Client). +state([{data,[{"State", State}]} | _]) -> + State; +state([_ | Rest]) -> + state(Rest). + %%-------------------------------------------------------------------- session_cache_process_list(doc) -> ["Test reuse of sessions (short handshake)"]; |