Browse Source

improving ENABLE_SELFSIGNED - cmake fill check for openssl now

Stasik0 10 years ago
parent
commit
998af668ed
2 changed files with 5 additions and 0 deletions
  1. 1 0
      CMakeLists.txt
  2. 4 0
      tools/certs/create_self-signed.py

+ 1 - 0
CMakeLists.txt

@@ -235,6 +235,7 @@ endif()
 option(GENERATE_SELFSIGNED "Generate self-signed certificates" OFF)
 if(GENERATE_SELFSIGNED)
     message(STATUS "Enabling self-signed certificates")
+    find_package(OpenSSL REQUIRED)
     add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/localhost.der
                               ${PROJECT_BINARY_DIR}/ca.crt
                    COMMAND python ${PROJECT_SOURCE_DIR}/tools/certs/create_self-signed.py ${PROJECT_BINARY_DIR}

+ 4 - 0
tools/certs/create_self-signed.py

@@ -48,5 +48,9 @@ os.remove("localhost.csr")
 os.remove("ca.key")
 os.remove("ca.srl")
 
+if os.path.isfile(os.path.join(sys.argv[1], "localhost.der")):
+	os.remove(os.path.join(sys.argv[1], "localhost.der"))
 shutil.move("localhost.der", sys.argv[1])
+if os.path.isfile(os.path.join(sys.argv[1], "ca.crt")):
+	os.remove(os.path.join(sys.argv[1], "ca.crt"))
 shutil.move("ca.crt", sys.argv[1])