<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear Ares Ou:</p>
<p><br>
</p>
<p>Thanks a lot!! Your response is very helpful!</p>
<p><br>
</p>
<p>I've read this article and I am still confused about several points.</p>
<p><br>
</p>
<p>Suppose I deploy my flask project on <b style="">example.herokuapp.com</b> and bought a new domain
<b>my.com</b> and resolute it to <span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><b>example.herokuapp.com</b>.</span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">1. In  Production Environment, I'm told that it's not recommended
 to use app.run(), instead <span><b>gunicorn</b> is recommended, how to implement HTTPS on gunicorn? I've checked gunicorn's doc and I found that gunicorn has <span>--keyfile and -certfile options. I suppose it will do the same thing, am I right?</span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><br>
</span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span>2. The second question is a serious one. The certification
 I bought is binded to <b>my.com</b>. </span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span>Suppose I use  <span><b>gunicorn manage:app --keyfile
  ssl_certificate/aaa.key --certfile ssl_certificate/aaa.pem </b>on my heroku server. </span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Heroku
 has its own https service, I don't need to do anything to make it work. </span></span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span>So when accessing <span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><b>example.herokuapp.com</b>,
 it will cause error. </span></span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">3.
 Actually, when accessing my project with <span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><b>my.com</b>, it also causes
 error and I haven't figured out why.</span></span></span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></span></span></span></span></span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span><span><span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">4.
 On Heroku website <a href="https://devcenter.heroku.com/articles/ssl-endpoint" class="OWAAutoLink" id="LPlnk757460">https://devcenter.heroku.com/articles/ssl-endpoint</a>, there's such a sentense:<br>
</p>
<div><i>To enable SSL on a custom domain, for example, www.example.com, use the SSL Endpoint add-on.<br>
SSL Endpoint is a paid add-on service. Please keep this in mind when provisioning the service.</i></div>
<div>Does that mean I have to use Heroku add-on (20$ a month, a lot for a student) to enable Https on<i> </i><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><b>my.com?
</b>Is it possible to make it happen with flask?</span></div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">5. I don't know if this mail should also be sent to the mailist,
 will it confuse the others?</span></div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Lu </span></div>
<p style="box-sizing: border-box; margin-right: 0px; margin-left: 0px; line-height: 1.6; padding: 0.5em 0px; color: rgb(96, 96, 96); font-family: benton-sans, "Helvetica Neue", helvetica, arial, sans-serif; font-size: 16px;">
</p>
</span></span></span></span></span></span>
<p></p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>发件人:</b> Ares Ou <aresowj@gmail.com><br>
<b>发送时间:</b> 2016年10月20日 0:39:06<br>
<b>收件人:</b> 陆 徐超<br>
<b>抄送:</b> flask@python.org<br>
<b>主题:</b> Re: [Flask] Question about SSL certificate on custom domain</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I guess you should check out how to implement HTTPS on the web server. </div>
<div>For example, Apache or Nginx. Of course the dev server in Flask also supports </div>
<div>SSL if you set it up correctly. I did a brief search and found this snippet which </div>
<div>might be helpful to you: <a href="http://flask.pocoo.org/snippets/111/">http://flask.pocoo.org/snippets/111/</a> . Let me know if you </div>
<div>have any question following this article.</div>
<div><br>
</div>
<div>Thanks.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Best regards,
<div>Ares Ou</div>
<div><br>
</div>
<div><b>Software Engineer / Full-Stack Python Developer</b></div>
<div><b><br>
</b></div>
<div><span style="font-size:12.8px"><b>Blog:</b> </span><a href="http://aresou.net" style="font-size:12.8px" target="_blank">http://aresou.net</a>  |  <span style="font-size:12.8px"><b>Github:</b>
</span><a href="https://github.com/aresowj" style="font-size:12.8px" target="_blank">https://github.com/aresowj</a></div>
<div><span style="font-size:12.8px"><b>Stack Overflow:</b> </span><a href="http://stackoverflow.com/users/5183727/ares-ou" style="font-size:12.8px" target="_blank">http://stackoverflow.com/users/5183727/ares-ou</a></div>
<div><br>
</div>
<div><font color="#ffffff">Ares Ou</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Wed, Oct 19, 2016 at 9:35 AM, 陆 徐超 <span dir="ltr"><<a href="mailto:luseiee@outlook.com" target="_blank">luseiee@outlook.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_5442590436387585510divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello Everyone:</p>
<p><br>
</p>
<p>I'm a beginner to web development.</p>
<p><br>
</p>
<p>I followed Miguel Grinberg's book and develop the flasky blog system. <span style="font-size:12pt">I deployed it to Heroku.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Now I bought a new domain name and resoluted the domain to my Heroku domain. When using the new domain, I found that it can't pass the SSL certification when using https. (Of course, the original Heroku URL is https enabled.) There's
 always a red cross on the URL in my Chrome browser.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">I bought a free CA from <span>Symantec and got two files .key and .pem.. Can anybody tell me how to use these two files in my FLASK project and make the https function well?</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span>And one more question. When I run my project with http using my own domain name, the user login state can't last long. I frequently need to login again. When I run it in https in Heroku domain name, it works well. Is that
 because the browser refresh the cookies under unsafe http browsing?</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span>Before reading this book, I have barely no idea about web, HTTP, maybe the question is a little bit silly.</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span>I hope someone could help me.</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span>Thanks a lot!</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span>Lu</span></span></p>
<p><span style="font-size:12pt"><span>2016.10.19</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
<p><span style="font-size:12pt"><span><br>
</span></span></p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/flask</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>