]> WPIA git - cassiopeia.git/blobdiff - src/apps/client.cpp
fix: clean SSL shutdown, reset, allowing deamon operation
[cassiopeia.git] / src / apps / client.cpp
index fabd221089e2d3e0a7ccad327e5c2a162ea0a66d..8ed2ca45eacbdd8fe9f1cd4a90f4d7d2c1047894 100644 (file)
@@ -50,11 +50,11 @@ int main( int argc, const char* argv[] ) {
 
     std::string path;
 
-    if( DAEMON ) {
-        path = "/etc/cacert/cassiopeia/cassiopeia.conf";
-    } else {
-        path = "config.txt";
-    }
+#ifdef NDEBUG
+    path = "/etc/cacert/cassiopeia/cassiopeia.conf";
+#else
+    path = "config.txt";
+#endif
 
     if( parseConfig( path ) != 0 ) {
         return -1;
@@ -95,6 +95,12 @@ int main( int argc, const char* argv[] ) {
                 std::cout << cert->csr_content << " content " << std::endl;
 
                 std::shared_ptr<SignedCertificate> res = sign->sign( cert );
+
+                if( !res ) {
+                    std::cout << "Error no cert came back." << std::endl;
+                    continue;
+                }
+
                 std::cout << "did it!" << res->certificate << std::endl;
                 std::string fn = writeBackFile( atoi( job->target.c_str() ), res->certificate );
                 res->crt_name = fn;