Browse Source

Fix windows script and warning (#1558)

Mark Giraud 6 years ago
parent
commit
2110c8892e
4 changed files with 6 additions and 5 deletions
  1. 1 0
      .gitignore
  2. 1 1
      CMakeLists.txt
  3. 0 1
      examples/encryption/server_basic128rsa15.c
  4. 4 3
      tools/certs/create_self-signed.py

+ 1 - 0
.gitignore

@@ -80,3 +80,4 @@ Makefile
 /build
 /.idea
 /cmake-build*
+/tools/certs/certs/*

+ 1 - 1
CMakeLists.txt

@@ -285,7 +285,7 @@ if(APPLE)
 endif()
 
 if(MSVC)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX") # Compiler warnings, error on warning
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /WX /w44996") # Compiler warnings, error on warning
 
   if(NOT BUILD_SHARED_LIB)
     set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS

+ 0 - 1
examples/encryption/server_basic128rsa15.c

@@ -4,7 +4,6 @@
 #include <signal.h>
 #include <stdio.h>
 #include <errno.h>
-#include <open62541.h>
 #include "open62541.h"
 
 static UA_ByteString loadFile(const char *const path) {

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

@@ -20,8 +20,9 @@ if len(sys.argv) == 3:
     keysize = int(sys.argv[2])
 
 certsdir = os.path.dirname(os.path.abspath(__file__))
+print(certsdir)
 os.environ['HOSTNAME'] = socket.gethostname()
-os.environ['OPENSSL_CONF'] = os.path.join(certsdir, "localhost.cnf")
+openssl_conf = os.path.join(certsdir, "localhost.cnf")
 
 os.chdir(os.path.abspath(sys.argv[1]))
 os.system("""openssl genrsa -out ca.key {}""".format(keysize))
@@ -47,8 +48,8 @@ os.system("""openssl x509 -req \
     -CAkey ca.key \
     -CAcreateserial \
     -out localhost.crt \
-    -extfile $OPENSSL_CONF \
-    -extensions v3_ca""")
+    -extfile {} \
+    -extensions v3_ca""".format(openssl_conf))
 os.system("openssl x509 -in localhost.crt -outform der -out server_cert.der")
 os.system("openssl rsa -inform PEM -in localhost.key -outform DER -out server_key.der")