diff options
author | Ingela Anderton Andin <[email protected]> | 2012-09-27 10:38:08 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-09-27 10:38:08 +0200 |
commit | 3ea4a5934c104aada07a8c971c0a2fd74d1e26f8 (patch) | |
tree | d683ded0ccb33525808617a55e737bdee6b79607 /lib/ssl/test/make_certs.erl | |
parent | 69bf3ed7ca0545fa350b3b95b650d79de59b85cd (diff) | |
parent | f421eabde4f5cbb0d4c718f2f07628626ab69c6a (diff) | |
download | otp-3ea4a5934c104aada07a8c971c0a2fd74d1e26f8.tar.gz otp-3ea4a5934c104aada07a8c971c0a2fd74d1e26f8.tar.bz2 otp-3ea4a5934c104aada07a8c971c0a2fd74d1e26f8.zip |
Merge branch 'ia/ssl/npn/OTP-10361'
* ia/ssl/npn/OTP-10361:
ssl: Shorten test case names to workaround ct shortcomings on windows
ssl: SSL 3.0 does not support next protocol negotiation
ssl: Dialyzer fixes and code cleaning
ssl: Changed default behaviour of next protocol negotiation to make more "sense" (be true to the specification).
ssl: Update SSL docs for SSL Next Protocol Support
ssl: Support for SSL Next Protocol Negotiation * http://technotes.googlecode.com/git/nextprotoneg.html
Diffstat (limited to 'lib/ssl/test/make_certs.erl')
-rw-r--r-- | lib/ssl/test/make_certs.erl | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl index 693289990c..4603a9f846 100644 --- a/lib/ssl/test/make_certs.erl +++ b/lib/ssl/test/make_certs.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -121,7 +121,19 @@ create_self_signed_cert(Root, OpenSSLCmd, CAName, Cnf) -> " -keyout ", KeyFile, " -out ", CertFile], Env = [{"ROOTDIR", Root}], - cmd(Cmd, Env). + cmd(Cmd, Env), + fix_key_file(OpenSSLCmd, KeyFile). + +% openssl 1.0 generates key files in pkcs8 format by default and we don't handle this format +fix_key_file(OpenSSLCmd, KeyFile) -> + KeyFileTmp = KeyFile ++ ".tmp", + Cmd = [OpenSSLCmd, " rsa", + " -in ", + KeyFile, + " -out ", + KeyFileTmp], + cmd(Cmd, []), + ok = file:rename(KeyFileTmp, KeyFile). create_ca_dir(Root, CAName, Cnf) -> CARoot = filename:join([Root, CAName]), @@ -139,7 +151,8 @@ create_req(Root, OpenSSLCmd, CnfFile, KeyFile, ReqFile) -> " -keyout ", KeyFile, " -out ", ReqFile], Env = [{"ROOTDIR", Root}], - cmd(Cmd, Env). + cmd(Cmd, Env), + fix_key_file(OpenSSLCmd, KeyFile). sign_req(Root, OpenSSLCmd, CA, CertType, ReqFile, CertFile) -> CACnfFile = filename:join([Root, CA, "ca.cnf"]), |