近期评论

tls密钥生成技巧

ssl和tls的加密过程就不说了。主要讲下密钥的制作过程。

编写密钥生成是的dn信息配置,免得要手动输入很麻烦。
vim thy.conf
#####################################################
[ req ]
default_bits = 1024
encrypt_key = yes
distinguished_name = req_dn
x509_extensions = cert_type
prompt = no

[ req_dn ]
C=CN
ST=GD
L=SZ
O=mopon
OU=devops
CN=mail.mopon.cn
emailAddress=postmaster@mopon.cn

[ cert_type ]
nsCertType = server
#####################################################

编写密钥的shell脚本:
vim thy.sh
#####################################################
#!/bin/sh
rm -rf ./*.pem

openssl genrsa -des3 -out ./tls_cakey.pem 2048

openssl req -config thy.conf \
-new -x509 -days 365 \
-key ./tls_cakey.pem -out ./tls_cacert.pem

openssl req -config thy.conf \
-new -x509 -nodes -days 365 \
-out ./tls_cert.pem -keyout ./tls_key.pem || exit 2

chmod 0600 ./*.pem

echo
openssl x509 -subject -fingerprint -noout -in ./tls_cert.pem || exit 2

cp ./tls_cacert.pem /etc/postfix/
cp ./tls_key.pem /etc/postfix/
cp ./tls_cert.pem /etc/postfix/
#####################################################

然后开始制作密钥,证书等文件。
sh thy.sh
提示输入密码,输入一个4个字符以上的密码即可。
Generating RSA private key, 2048 bit long modulus
…………………………………………………………..+++
……………………………+++
e is 65537 (0x10001)
Enter pass phrase for ./tls_cakey.pem:
Verifying – Enter pass phrase for ./tls_cakey.pem:
Enter pass phrase for ./tls_cakey.pem:
Generating a 1024 bit RSA private key
……………………….++++++
………..++++++
writing new private key to './tls_key.pem'
—–

subject= /C=CN/ST=GD/L=SZ/O=mopon/OU=devops/CN=mail.mopon.cn/emailAddress=postmaster@mopon.cn
SHA1 Fingerprint=24:36:CF:A9:31:49:F1:EB:7B:DC:20:88:0C:84:C5:B4:08:16:99:87

如果成功的话会有上面的输出结果,并产生了4个pem文件。smtp只用到了其中3个:
tls_cacert.pem,tls_key.pem和tls_cert.pem

dovecot只用到其中两个:
tls_key.pem和tls_cert.pem

137 Responses to “tls密钥生成技巧”

  • It’s appropriate time to make some plans for the
    future and it is time to be happy. I have read this post and if I could I want to suggest you some interesting things or
    suggestions. Maybe you can write next articles referring to this
    article. I desire to read more things about it!

  • Admiring the dedication you put into your blog and detailed information you offer.

    It’s great to come across a blog every once in a while that isn’t
    the same unwanted rehashed material. Wonderful read! I’ve
    bookmarked your site and I’m including your RSS feeds to my Google account.

  • Iola Ohmer说道:

    This website online is really a stroll-by means of for all the information you wanted about this and didn’t know who to ask. Glimpse here, and also you’ll definitely discover it.

  • Proxy account说道:

    I aam really impressed with your writing skills as well as with the
    layout on your blog. Is this a paid theme or did you modify it yourself?
    Anyway keep up the nice quality writing, it is rare to see a
    nice blog like this one today.

  • Thanks for your marvelous posting! I definitely enjoyed reading it, you could be a great author.I will remember to bookmark your blog and will eventually come back in the foreseeable future. I want to encourage you continue your great work, have a nice morning!|

  • bookmarked!!, I love your website!|

  • Hmm is anyone else experiencing problems with the images on this blog loading? I’m trying to find out if its a problem on my end or if it’s the blog. Any responses would be greatly appreciated.|

  • Heya i am for the primary time here. I found this board and I find It really useful & it helped me out a lot. I’m hoping to present one thing again and help others like you helped me.|

  • What’s up, the whole thing is going nicely here and ofcourse every one is sharing information, that’s in fact good, keep up writing.|

  • Hello I am so happy I found your blog page, I really found you by accident, while I was searching on Bing for something else, Anyhow I am here now and would just like to say cheers for a remarkable post and a all round exciting blog (I also love the theme/design), I don’t have time to go through it all at the minute but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read more, Please do keep up the great jo.|

  • When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove me from that service? Appreciate it!|

  • This web site truly has all the info I needed concerning this subject and didn’t know who to ask. |

  • After checking out a few of the articles on your blog, I honestly like your technique of writing a blog. I bookmarked it to my bookmark website list and will be checking back in the near future. Please check out my web site as well and let me know what you think.|

  • Dadado Veig说道:

    This is my first time visit at here and i am truly pleassant to read all at alone place.|

  • I was wondering if you ever considered changing the structure of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 pictures. Maybe you could space it out better?|

  • Itamar Serp说道:

    I think that is one of the most important information for me. And i am glad reading your article. However want to statement on some common things, The site taste is ideal, the articles is really excellent : D. Excellent job, cheers|

  • Hi, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam comments? If so how do you stop it, any plugin or anything you can suggest? I get so much lately it’s driving me crazy so any support is very much appreciated.|

  • Hi everyone, it’s my first pay a visit at this web page, and post is truly fruitful designed for me, keep up posting such articles.|

  • bookmarked!!, I really like your website!|

  • I know this web page offers quality dependent articles or reviews and other information, is there any other web page which provides these kinds of things in quality?|

  • I have read so many posts about the blogger lovers except this post is genuinely a good article, keep it up.|

  • Good web site you have here.. It’s hard to find excellent writing like yours these days. I seriously appreciate individuals like you! Take care!!|

  • Awesome blog! Do you have any recommendations for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m completely confused .. Any recommendations? Appreciate it!|

  • Your style is so unique compared to other people I’ve read stuff from. Thank you for posting when you have the opportunity, Guess I’ll just book mark this blog.|

  • Egli Diana Pinto说道:

    I’ve been surfing online more than 4 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the net will be much more useful than ever before.|

  • When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove people from that service? Thanks a lot!|

  • Pretty nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed surfing around your blog posts. In any case I will be subscribing to your feed and I hope you write again very soon!|

  • Hello, i think that i saw you visited my blog thus i got here to go back the favor?.I am attempting to find issues to improve my site!I guess its ok to make use of some of your ideas!!|

  • Hello, Neat post. There’s a problem together with your site in web explorer, may test this? IE nonetheless is the marketplace chief and a huge component to other people will miss your magnificent writing because of this problem.|

  • I was suggested this web site by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my problem. You’re incredible! Thanks!|

  • Howdy! Someone in my Facebook group shared this website with us so I came to check it out. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Outstanding blog and amazing style and design.|

  • Hi there! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any suggestions?|

  • Great beat ! I would like to apprentice while you amend your web site, how can i subscribe for a weblog website? The account helped me a appropriate deal. I have been tiny bit acquainted of this your broadcast offered vibrant transparent idea|

  • I really like what you guys are up too. This type of clever work and coverage! Keep up the very good works guys I’ve incorporated you guys to blogroll.|

  • Dadado Veig说道:

    Hi everyone, it’s my first visit at this website, and paragraph is truly fruitful in favor of me, keep up posting such articles or reviews.|

  • Lelio Junior说道:

    First of all I want to say excellent blog! I had a quick question in which I’d like to ask if you don’t mind. I was interested to find out how you center yourself and clear your head prior to writing. I’ve had a hard time clearing my mind in getting my ideas out. I truly do enjoy writing however it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin. Any recommendations or tips? Thank you!|

  • My family every time say that I am wasting my time here at web, however I know I am getting know-how daily by reading thes pleasant posts.|

  • Hi all, here every one is sharing these kinds of experience, so it’s nice to read this web site, and I used to go to see this web site every day.|

  • What’s up to all, how is the whole thing, I think every one is getting more from this web site, and your views are nice for new people.|

  • Lelio Junior说道:

    I’d like to thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade blog posts from you in the future as well. In fact, your creative writing abilities has inspired me to get my own, personal blog now ;)|

  • Hey There. I found your blog using msn. This is a really well written article. I will make sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will certainly return.|

  • Have you ever considered writing an e-book or guest authoring on other sites? I have a blog centered on the same topics you discuss and would love to have you share some stories/information. I know my viewers would enjoy your work. If you’re even remotely interested, feel free to send me an email.|

  • I’m really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it’s rare to see a nice blog like this one these days.|

  • Paragraph writing is also a fun, if you know after that you can write otherwise it is difficult to write.|

  • I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.|

  • This design is steller! You definitely know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job. I really loved what you had to say, and more than that, how you presented it. Too cool!|

  • This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your great post. Also, I have shared your web site in my social networks!|

  • whoah this blog is great i really like studying your articles. Keep up the good work! You understand, many people are looking round for this information, you can help them greatly. |

  • Lelio Junior说道:

    Today, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a 40 foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views. I know this is completely off topic but I had to share it with someone!|

  • Hey! I understand this is somewhat off-topic however I had to ask. Does operating a well-established blog like yours take a massive amount work? I am completely new to writing a blog however I do write in my diary on a daily basis. I’d like to start a blog so I will be able to share my own experience and views online. Please let me know if you have any kind of suggestions or tips for new aspiring bloggers. Thankyou!|

  • Lelio Junior说道:

    Simply wish to say your article is as astonishing. The clarity to your post is simply cool and i could assume you are a professional on this subject. Well with your permission allow me to snatch your feed to stay up to date with coming near near post. Thanks one million and please keep up the gratifying work.|

  • You really make it appear so easy with your presentation but I find this topic to be actually one thing which I feel I would never understand. It seems too complex and extremely wide for me. I’m looking forward for your next post, I’ll try to get the hang of it!|

  • I’m gone to say to my little brother, that he should also pay a quick visit this weblog on regular basis to get updated from hottest information.|

  • It’s really a great and useful piece of information. I am glad that you just shared this useful information with us. Please stay us informed like this. Thank you for sharing.|

  • Grupo Coral说道:

    Excellent blog post. I certainly love this site. Stick with it!|

  • I simply couldn’t leave your site before suggesting that I really enjoyed the usual info a person provide in your visitors? Is going to be back continuously to inspect new posts|

  • wireless sensors说道:

    At this moment I am ready to do my breakfast, later than having my breakfast coming again to read additional news.

  • timex check说道:

    Your mode of explaining everything in this piece of writing is really good, all can easily be aware
    of it, Thanks a lot.

  • website design说道:

    Thankfulness to my father who informed me about this website, this weblog
    is actually remarkable.

  • contract phones说道:

    Link exchange is nothing else however it is just placing the other person’s blog link
    on your page at appropriate place and other person will also do same in support
    of you.

  • WOW just what I was looking for. Came here by searching for auto scan tool

  • Its not my first time to pay a visit this web
    site, i am visiting this site dailly and obtain nice information from here every day.

  • Produce moving deck entry way in your property area?

Leave a Reply