Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
If you have mongoDB as your database and you query on DB from an external network, make sure you have SSL in place. By not using SSL everyone can evesdrop on the network data which is transmitted in between.

Read the below article to set SSL on server side:

- https://docs.mongodb.com/manual/tutorial/configure-ssl/

Now in order to set SSL=True in mongo python driver head over to link below to read more on:

- http://api.mongodb.com/python/current/examples/tls.html

#mongodb #ssl #tls #pymongo
A couple days ago we talked about MongoDB that uses TLS/SSL to encrypt the communication with clients connecting to it (like pyMongo). Now if you want to test MongoDB with self-signed certificate you can generate one with the command below:

cd /etc/ssl/
openssl req -newkey rsa:2048 -new -x509 -days 365 -nodes -out mongodb-cert.crt -keyout mongodb-cert.key


This operation generates a new, self-signed certificate with no passphrase that is valid for 365 days. Once you have the certificate, concatenate the certificate and private key to a .pem file, as in the following example:

cat mongodb-cert.key mongodb-cert.crt > mongodb.pem


If using the YAML configuration file format, include the following configuration in the file:

net:
ssl:
mode: requireSSL
PEMKeyFile: /etc/ssl/mongodb.pem

NOTE: instead of requireSSL you can use preferSSL to not force the requirement. It depends on the requirements and network topolgy.


#mongodb #ssl #tls #pem #openssl
Why Axigen Mail Server log gives the error of Unable to perform STARTTLS and how to solve it?

Axigen by default initiate a TLS connection with the target mail server. When the target mail server does not accept TLS, Axigen will mark the mail message as Relay error with the error of Unable to perform STARTTLS.

It is suggest to leave this behaviour as is, but in case there is an exception that you want to send mail to that mail server you need to ignore TLS for the target. In order to do so login to Axigen webadmin interface and:

1- Navigate to Security & Filtering -> Acceptance & Routing -> Advanced Settings

2- Click the Add Acceptance / Routing Rule button

3- Write a suggestive name for the rule like disable_tls_example_com

4- In the Conditions section add the following two conditions:
- Recipient -> Domain -> add the condition -> select 'Is' from the combo box -> write Name_of_the_domain (example.com) in the combo box.
- Delivery -> Relaying mail -> click add the condition

5- Select at the top of the Conditions section For incoming messages that match -> ALL of the conditions below (instead of the default `ANY of the conditions below`)

6- in the Actions section select Settings -> Allow StartTLS -> add the action. DO NOT tick the check-box next to Allow StartTLS.

Now click SAVE CONFIGURATION button. Your're done and you should see something like below in your axigen log file:

Set recipient <info@example.com> state to SENT

#mailserver #axigen #TLS #STARTTLS