Skip to content

Commit

Permalink
Update based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
LostKobrakai authored and jjcarstens committed Jul 5, 2022
1 parent e711bbd commit b4d9ae7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ defmodule NervesHubDeviceWeb.WebsocketTest do
refute_receive({"presence_diff", _})
end

test "already registered certificate with expired signer CA can connect", %{user: user} do
test "already registered expired certificate with expired signer CA can connect", %{
user: user
} do
org = Fixtures.org_fixture(user, %{name: "custom_ca_test"})
{device, _firmware} = device_fixture(user, %{identifier: @valid_serial}, org)

Expand All @@ -206,10 +208,6 @@ defmodule NervesHubDeviceWeb.WebsocketTest do

key = X509.PrivateKey.new_ec(:secp256r1)

not_before = Timex.now() |> Timex.shift(days: -2)
not_after = Timex.now() |> Timex.shift(days: 1)
validity = X509.Certificate.Validity.new(not_before, not_after)

cert =
key
|> X509.PublicKey.derive()
Expand Down Expand Up @@ -372,7 +370,7 @@ defmodule NervesHubDeviceWeb.WebsocketTest do
end

describe "Custom CA Signers" do
test "vaild certificate can connect", %{user: user} do
test "valid certificate can connect", %{user: user} do
org = Fixtures.org_fixture(user, %{name: "custom_ca_test"})
{device, _firmware} = device_fixture(user, %{identifier: @valid_serial}, org)

Expand Down

0 comments on commit b4d9ae7

Please sign in to comment.