-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
207 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
if(NOT EXISTS rootcacert.pem) | ||
message(FATAL_ERROR "file does not exist") | ||
endif() | ||
|
||
if(NOT EXISTS tlcp_server_certs.pem) | ||
message(FATAL_ERROR "file does not exist") | ||
endif() | ||
|
||
if(NOT EXISTS signkey.pem) | ||
message(FATAL_ERROR "file does not exist") | ||
endif() | ||
|
||
if(NOT EXISTS enckey.pem) | ||
message(FATAL_ERROR "file does not exist") | ||
endif() | ||
|
||
execute_process( | ||
COMMAND bash -c "sudo nohup gmssl tlcp_server -port 4433 -cert tlcp_server_certs.pem -key signkey.pem -pass P@ssw0rd -ex_key enckey.pem -ex_pass P@ssw0rd > tlcp_server.log 2>&1 &" | ||
RESULT_VARIABLE SERVER_RESULT | ||
TIMEOUT 5 | ||
) | ||
if(NOT ${SERVER_RESULT} EQUAL 0) | ||
message(FATAL_ERROR "server failed to start") | ||
endif() | ||
|
||
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 2) | ||
|
||
execute_process( | ||
COMMAND bash -c "gmssl tlcp_client -host localhost -port 4433 -cacert rootcacert.pem > tlcp_client.log 2>&1" | ||
RESULT_VARIABLE CLIENT_RESULT | ||
TIMEOUT 5 | ||
) | ||
|
||
file(READ "tlcp_client.log" CLIENT_LOG_CONTENT) | ||
string(FIND "${CLIENT_LOG_CONTENT}" "Connection established" FOUND_INDEX) | ||
|
||
if(${FOUND_INDEX} EQUAL -1) | ||
message(FATAL_ERROR "Client did not establish connection with server.") | ||
endif() | ||
|
||
execute_process( | ||
COMMAND sudo pkill -f "gmssl" | ||
) | ||
|
Oops, something went wrong.