From: Jean-Marc Pigeon (Delson) Date: Thu, 19 Jun 2025 22:44:00 +0000 (-0400) Subject: TLS link seemd to be working better X-Git-Tag: tag-0.9~78 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=96fbac188e6fbd3bc7eec7424b3b821febca71f5;p=jmp%2Fmailleur TLS link seemd to be working better --- diff --git a/1 b/1 new file mode 100644 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 diff --git a/Makefile b/Makefile index 9e9318a..65c1160 100644 --- 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 \ diff --git a/Makefile.dbg b/Makefile.dbg index c5f6066..71fda5b 100644 --- a/Makefile.dbg +++ b/Makefile.dbg @@ -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 \ diff --git a/lib/devsoc.c b/lib/devsoc.c index b54a842..ad7ae98 100644 --- a/lib/devsoc.c +++ b/lib/devsoc.c @@ -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 diff --git a/lib/lvleml.c b/lib/lvleml.c index 40793f0..3ac0e7d 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -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",