]> SAFE projects GIT repository - jmp/mailleur/commitdiff
TLS link seemd to be working better
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 19 Jun 2025 22:44:00 +0000 (18:44 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 19 Jun 2025 22:44:00 +0000 (18:44 -0400)
1 [new file with mode: 0644]
Makefile
Makefile.dbg
lib/devsoc.c
lib/lvleml.c

diff --git a/1 b/1
new file mode 100644 (file)
index 0000000..fa5c6ec
--- /dev/null
+++ b/1
@@ -0,0 +1,8 @@
+Connecting to 127.127.10.25
+depth=2 C=CA, L=Montreal, ST=Quebec, O=SAFE Inc., OU=Digital Certificate Signing, CN=SAFE Root CA 1
+verify return:1
+depth=1 C=CA, O=SAFE Inc., OU=Digital Certificate Signing, CN=SAFE Midle Ground CA (2024) - SHA384 - 3
+verify return:1
+depth=0 C=CA, ST=Quebec, L=Montreal, O=SAFE Inc., OU=Mailleur email developpement test, CN=mailleur.example.com
+verify return:1
+250 AUTH PLAIN LOGIN\r
index 9e9318a6d3672139eed095975272bcf984feba30..65c1160b5b77651afdaa403daa713c2c37da21ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -94,13 +94,25 @@ tlsrcvr     :
                        -cert certs/localhost-cert.pem  \
                        -key certs/localhost-key.pem    \
                        -starttls smtp                  \
-                       -connect mx1.free.fr:25
+                       -connect courriel.colba.net:25
 #                      -connect smtp1.example.com:25
 #                      -connect mailpostg.example.com:25
 #                      -connect courriel.colba.net:25
 #                      -connect mx1.free.fr:25
 #                      -connect $(TESTSRV):$(TESTPORT) 
 
+tlsmx1 :
+               @ clear
+                openssl s_client                       \
+                       -trace                          \
+                       -crlf                           \
+                       -status                         \
+                       -CAfile certs/root-safe_CA.pem  \
+                       -cert certs/localhost-cert.pem  \
+                       -key certs/localhost-key.pem    \
+                       -starttls smtp                  \
+                       -connect mx1.free.fr:25
+
 go465  :
                @ clear
                @ openssl s_client                      \
index c5f60667f915a75c3f1eb95766d5edcbcee4c3f5..71fda5bcf0e8dae7895aa6375ac116d75122fc67 100644 (file)
@@ -26,6 +26,13 @@ EMLPAR       =                                               \
 #====================================================================
 #area to start components receiver,sorter,sender once at a time
 #--------------------------------------------------------------------
+gorcvr :  clean debug
+          @                                            \
+            ./bin/receiver                             \
+               -f                                      \
+               $(EMLPAR)$(TESTITER)
+
+
 onercvr        :  clean debug newtest
           @                                            \
             ./bin/receiver                             \
@@ -33,6 +40,7 @@ onercvr       :  clean debug newtest
                $(EMLPAR)$(TESTITER)
 
 #                      # -i 127.63.31.15
+#
 onefeed        :  debug
           @ bin/feeder                                 \
                        -f                              \
index b54a842e1a7cac8b4792a30d11c3c55ac0958277..ad7ae980a501e4f65b4849f9e62fc4224fcf7b3d 100644 (file)
@@ -1482,28 +1482,18 @@ SOCTYP *soc;
 ok=false;
 soc=(SOCTYP *)socptr;
 if ((soc!=(SOCTYP *)0)&&(soc->modtls==false)) {
-  int tosend;
-  char *peerip;
-  char buffer[100];
 
-  peerip=soc_getaddrinfo(socptr,false,false);
-  switch (server)       {
-    case true   :
-      (void) usleep(100000);        //lets wait for 100 millisec
-      tosend=snprintf(buffer,sizeof(buffer),"%d 2.0.0 Ready to start TLS%s",
-                                            SIGNON,CRLF);
-      (void) soc_writebuffer(soc,buffer,tosend);
-      break;
-    case false   :
-      break;
-    }
   soc->tls=tls_opentls(soc->handle,server);
   if (soc->tls!=(TLSTYP *)0) {
+    char *peerip;
+
+    peerip=(char *)0;
     soc->proto=pro_smtps;
     soc->modtls=true;
     ok=true;
     switch (server)       {
       case true   :
+        peerip=soc_getaddrinfo(socptr,false,false);
         (void) socpurge(soc,peerip);
         break;
       case false  :
@@ -1511,8 +1501,8 @@ if ((soc!=(SOCTYP *)0)&&(soc->modtls==false)) {
       }
     (void) tls_verify(soc->tls);
     soc->cipherid=tls_getcipherid(soc->tls);
+    peerip=rou_freestr(peerip);
     }
-  peerip=rou_freestr(peerip);
   }
 return ok;
 #undef  OPEP
index 40793f0e620809a4de45f2bc688a54f58dbef4c3..3ac0e7d66774d7080866e25dfa440a6c810ac912 100644 (file)
@@ -186,13 +186,17 @@ static void linkready(CONTYP *contact,_Bool suite)
 
 {
 const char *mode;
+_Bool flush;
 char sepa;
 
 sepa=' ';
-if (suite==true)
+flush=true;
+if (suite==true) {
+  flush=false;
   sepa='-';
+  }
 mode=soc_getstrmode(contact->socptr);
-(void) transmit(contact,true,"%d%c%s, link (%s) ready, your IP/FQDN=[%s/%s]",
+(void) transmit(contact,flush,"%d%c%s, link (%s) ready, your IP/FQDN=[%s/%s]",
                               CMDOK,sepa,contact->locname,mode,
                               contact->peerip,contact->peername);
 }
@@ -1469,17 +1473,10 @@ while (proceed==true) {
       proceed=doreset(contact,line);
       break;
     case c_starttls     :       //EHLO start encrypted link in server mode
+      (void) usleep(100000);
+      (void) transmit(contact,true,"%d 2.0.0 Ready to start TLS",SIGNON);
       switch (soc_starttls(contact->socptr,true)) {
         case true       :       //link now in TLS crypted mode
-          char *loc;
-          
-          loc=strdup(contact->fqdn); 
-          //(void) doehlo(contact,loc);
-          loc=rou_freestr(loc);
-/*  JMPDBG
-          (void) transmit(contact,"%d Link now encrypted (cipher=<%s>)",
-                                   CMDOK,soc_get_cipher_name(contact->socptr));
-*/
           break;
         case false      :       //unable to establish link
           (void) transmit(contact,true,"%d 5.3.3 command starttls not successful",