Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

follow upstream public_key api changes to fix ssl tests #6

Closed
wants to merge 1 commit into from

2 participants

@mabrek

No description provided.

@wg
Owner
wg commented

Thanks!

@wg wg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2011
  1. @mabrek
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 5 deletions.
  1. +6 −5 test_src/pgsql_tests.erl
View
11 test_src/pgsql_tests.erl
@@ -3,7 +3,7 @@
-export([run_tests/0]).
-include_lib("eunit/include/eunit.hrl").
--include_lib("ssl/include/OTP-PKIX.hrl").
+-include_lib("public_key/include/public_key.hrl").
-include("pgsql.hrl").
-define(host, "localhost").
@@ -48,7 +48,7 @@ connect_with_invalid_password_test() ->
connect_with_ssl_test() ->
- lists:foreach(fun application:start/1, [crypto, ssl]),
+ lists:foreach(fun application:start/1, [crypto, public_key, ssl]),
with_connection(
fun(C) ->
{ok, _Cols, [{true}]} = pgsql:equery(C, "select ssl_is_used()")
@@ -57,12 +57,13 @@ connect_with_ssl_test() ->
[{ssl, true}]).
connect_with_client_cert_test() ->
- lists:foreach(fun application:start/1, [crypto, ssl]),
+ lists:foreach(fun application:start/1, [crypto, public_key, ssl]),
Dir = filename:join(filename:dirname(code:which(pgsql_tests)), "../test_data"),
File = fun(Name) -> filename:join(Dir, Name) end,
- {ok, [{cert, Der, _}]} = public_key:pem_to_der(File("epgsql.crt")),
- {ok, Cert} = public_key:pkix_decode_cert(Der, plain),
+ {ok, CertBin} = file:read_file(File("epgsql.crt")),
+ [{'Certificate', Der, _}] = public_key:pem_decode(CertBin),
+ Cert = public_key:pkix_decode_cert(Der, plain),
#'TBSCertificate'{serialNumber = Serial} = Cert#'Certificate'.tbsCertificate,
Serial2 = list_to_binary(integer_to_list(Serial)),
Something went wrong with that request. Please try again.