Skip to content

Commit 278f395

Browse files
Made sure the relative paths for finding the certificates is correct.
1 parent 6893123 commit 278f395

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

wrapper/Ada/tls_client.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ package body Tls_Client with SPARK_Mode is
101101

102102
Any_Inet_Addr : Inet_Addr_Type renames SPARK_Sockets.Any_Inet_Addr;
103103

104-
CERT_FILE : constant String := "../certs/client-cert.pem";
105-
KEY_FILE : constant String := "../certs/client-key.pem";
106-
CA_FILE : constant String := "../certs/ca-cert.pem";
104+
CERT_FILE : constant String := "../../../certs/client-cert.pem";
105+
KEY_FILE : constant String := "../../../certs/client-key.pem";
106+
CA_FILE : constant String := "../../../certs/ca-cert.pem";
107107

108108
subtype Byte_Array is WolfSSL.Byte_Array;
109109

wrapper/Ada/tls_server.adb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ package body Tls_Server with SPARK_Mode is
8787

8888
Any_Inet_Addr : Inet_Addr_Type renames SPARK_Sockets.Any_Inet_Addr;
8989

90-
CERT_FILE : constant String := "../certs/server-cert.pem";
91-
KEY_FILE : constant String := "../certs/server-key.pem";
92-
CA_FILE : constant String := "../certs/client-cert.pem";
90+
CERT_FILE : constant String := "../../../certs/server-cert.pem";
91+
KEY_FILE : constant String := "../../../certs/server-key.pem";
92+
CA_FILE : constant String := "../../../certs/client-cert.pem";
9393

9494
subtype Byte_Array is WolfSSL.Byte_Array;
9595

@@ -305,7 +305,11 @@ package body Tls_Server with SPARK_Mode is
305305
Put_Line ("ERROR: failed to write full response.");
306306
end if;
307307

308-
Result := WolfSSL.Shutdown (Ssl);
308+
for I in 1 .. 3 loop
309+
Result := WolfSSL.Shutdown (Ssl);
310+
exit when Result = Success;
311+
delay 0.001; -- Delay is expressed in seconds.
312+
end loop;
309313
if Result /= Success then
310314
Put_Line ("ERROR: Failed to shutdown WolfSSL context.");
311315
end if;

0 commit comments

Comments
 (0)