How to run a Flask app on CherryPy WSGI server (Cheroot) using HTTPS?Using CherryPy/Cherryd to launch multiple Flask instancesHow to get data received in Flask requestHow can I use an app-factory in Flask / WSGI servers and why might it be unsafe?How to organize a multiple apps server with CherryPy?How to monitor this cherrypy web application with newrelic and probably convert it to wsgiIssues with Deploying Flask app on Ubuntu 14.04 VPS (Digital Ocean)Run cherrypy example on openshiftFlask app hosted by CherryPy: OPTIONS returns 404Deploying Flask app on CherryPy serverPython Flask REST API on Windows Cherrypy

Why didn't Stark and Nebula use jump points with their ship to go back to Earth?

How close to the Sun would you have to be to hear it?

Why did some Apollo missions carry a grenade launcher?

What is a good example for artistic ND filter applications?

What does "in official capacity" mean?

How do I make my photos have more impact?

Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?

Raindrops in Python

Verb Classification of あげる (to give)

Would it take any sort of amendment to make DC a state?

What language is Raven using for her attack in the new 52?

How can I convert a linear narrative into a branching narrative?

What is the source of this clause, often used to mark the completion of something?

Why are subdominants unstable?

Should students have access to past exams or an exam bank?

My employer is refusing to give me the pay that was advertised after an internal job move

"DDoouubbllee ssppeeaakk!!"

What are the cons of stateless password generators?

How do you deal with characters with multiple races?

Was the Psych theme song written for the show?

Is Ear Protection Necessary For General Aviation Airplanes?

Exploiting the delay when a festival ticket is scanned

How did the SysRq key get onto modern keyboards if it's rarely used?

How can flights operated by the same company have such different prices when marketed by another?



How to run a Flask app on CherryPy WSGI server (Cheroot) using HTTPS?


Using CherryPy/Cherryd to launch multiple Flask instancesHow to get data received in Flask requestHow can I use an app-factory in Flask / WSGI servers and why might it be unsafe?How to organize a multiple apps server with CherryPy?How to monitor this cherrypy web application with newrelic and probably convert it to wsgiIssues with Deploying Flask app on Ubuntu 14.04 VPS (Digital Ocean)Run cherrypy example on openshiftFlask app hosted by CherryPy: OPTIONS returns 404Deploying Flask app on CherryPy serverPython Flask REST API on Windows Cherrypy






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am running a Python 2.7 Flask app on CherryPy Cheroot WSGI server usinh HTTP now as below.



from cheroot.wsgi import Server as WSGIServer
from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher

from MyFlaskApp import app

d = WSGIPathInfoDispatcher('/': app)
server = WSGIServer(('0.0.0.0', 80), d)

if __name__ == '__main__':
try:
server.start()
except KeyboardInterrupt:
server.stop()


What would I have to to move to HTTPS from here?
I found below instruction, but it does not seem to applicable to my application.



from cheroot.server import HTTPServer
from cheroot.ssl.builtin import BuiltinSSLAdapter

HTTPServer.ssl_adapter = BuiltinSSLAdapter(
certificate='cert/domain.crt',
private_key='cert/domain.key')


Can I apply above sample to my Flask app on Cheroot? If not, what would be a simple example for Flask app on Cheroot for HTTPS?










share|improve this question
































    0















    I am running a Python 2.7 Flask app on CherryPy Cheroot WSGI server usinh HTTP now as below.



    from cheroot.wsgi import Server as WSGIServer
    from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher

    from MyFlaskApp import app

    d = WSGIPathInfoDispatcher('/': app)
    server = WSGIServer(('0.0.0.0', 80), d)

    if __name__ == '__main__':
    try:
    server.start()
    except KeyboardInterrupt:
    server.stop()


    What would I have to to move to HTTPS from here?
    I found below instruction, but it does not seem to applicable to my application.



    from cheroot.server import HTTPServer
    from cheroot.ssl.builtin import BuiltinSSLAdapter

    HTTPServer.ssl_adapter = BuiltinSSLAdapter(
    certificate='cert/domain.crt',
    private_key='cert/domain.key')


    Can I apply above sample to my Flask app on Cheroot? If not, what would be a simple example for Flask app on Cheroot for HTTPS?










    share|improve this question




























      0












      0








      0








      I am running a Python 2.7 Flask app on CherryPy Cheroot WSGI server usinh HTTP now as below.



      from cheroot.wsgi import Server as WSGIServer
      from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher

      from MyFlaskApp import app

      d = WSGIPathInfoDispatcher('/': app)
      server = WSGIServer(('0.0.0.0', 80), d)

      if __name__ == '__main__':
      try:
      server.start()
      except KeyboardInterrupt:
      server.stop()


      What would I have to to move to HTTPS from here?
      I found below instruction, but it does not seem to applicable to my application.



      from cheroot.server import HTTPServer
      from cheroot.ssl.builtin import BuiltinSSLAdapter

      HTTPServer.ssl_adapter = BuiltinSSLAdapter(
      certificate='cert/domain.crt',
      private_key='cert/domain.key')


      Can I apply above sample to my Flask app on Cheroot? If not, what would be a simple example for Flask app on Cheroot for HTTPS?










      share|improve this question
















      I am running a Python 2.7 Flask app on CherryPy Cheroot WSGI server usinh HTTP now as below.



      from cheroot.wsgi import Server as WSGIServer
      from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher

      from MyFlaskApp import app

      d = WSGIPathInfoDispatcher('/': app)
      server = WSGIServer(('0.0.0.0', 80), d)

      if __name__ == '__main__':
      try:
      server.start()
      except KeyboardInterrupt:
      server.stop()


      What would I have to to move to HTTPS from here?
      I found below instruction, but it does not seem to applicable to my application.



      from cheroot.server import HTTPServer
      from cheroot.ssl.builtin import BuiltinSSLAdapter

      HTTPServer.ssl_adapter = BuiltinSSLAdapter(
      certificate='cert/domain.crt',
      private_key='cert/domain.key')


      Can I apply above sample to my Flask app on Cheroot? If not, what would be a simple example for Flask app on Cheroot for HTTPS?







      python python-2.7 flask wsgi cherrypy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 23:34







      Kay

















      asked Mar 26 at 21:23









      KayKay

      11810 bronze badges




      11810 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          2














          I figured out the necessary modification.
          Not much information on Flask app on Cheroot with https, so I thought I'd share it.



          from cheroot.wsgi import Server as WSGIServer
          from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher
          from cheroot.ssl.builtin import BuiltinSSLAdapter

          from MyFlaskApp import app

          my_app = WSGIPathInfoDispatcher('/': app)
          server = WSGIServer(('0.0.0.0', 443), my_app)

          ssl_cert = "[path]/myapp.crt"
          ssl_key = "[path]/myapp.key"
          server.ssl_adapter = BuiltinSSLAdapter(ssl_cert, ssl_key, None)

          if __name__ == '__main__':
          try:
          server.start()
          except KeyboardInterrupt:
          server.stop()





          share|improve this answer



























          • AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

            – webKnjaZ
            Apr 1 at 12:23











          • Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

            – webKnjaZ
            Apr 1 at 12:24










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366395%2fhow-to-run-a-flask-app-on-cherrypy-wsgi-server-cheroot-using-https%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          I figured out the necessary modification.
          Not much information on Flask app on Cheroot with https, so I thought I'd share it.



          from cheroot.wsgi import Server as WSGIServer
          from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher
          from cheroot.ssl.builtin import BuiltinSSLAdapter

          from MyFlaskApp import app

          my_app = WSGIPathInfoDispatcher('/': app)
          server = WSGIServer(('0.0.0.0', 443), my_app)

          ssl_cert = "[path]/myapp.crt"
          ssl_key = "[path]/myapp.key"
          server.ssl_adapter = BuiltinSSLAdapter(ssl_cert, ssl_key, None)

          if __name__ == '__main__':
          try:
          server.start()
          except KeyboardInterrupt:
          server.stop()





          share|improve this answer



























          • AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

            – webKnjaZ
            Apr 1 at 12:23











          • Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

            – webKnjaZ
            Apr 1 at 12:24















          2














          I figured out the necessary modification.
          Not much information on Flask app on Cheroot with https, so I thought I'd share it.



          from cheroot.wsgi import Server as WSGIServer
          from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher
          from cheroot.ssl.builtin import BuiltinSSLAdapter

          from MyFlaskApp import app

          my_app = WSGIPathInfoDispatcher('/': app)
          server = WSGIServer(('0.0.0.0', 443), my_app)

          ssl_cert = "[path]/myapp.crt"
          ssl_key = "[path]/myapp.key"
          server.ssl_adapter = BuiltinSSLAdapter(ssl_cert, ssl_key, None)

          if __name__ == '__main__':
          try:
          server.start()
          except KeyboardInterrupt:
          server.stop()





          share|improve this answer



























          • AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

            – webKnjaZ
            Apr 1 at 12:23











          • Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

            – webKnjaZ
            Apr 1 at 12:24













          2












          2








          2







          I figured out the necessary modification.
          Not much information on Flask app on Cheroot with https, so I thought I'd share it.



          from cheroot.wsgi import Server as WSGIServer
          from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher
          from cheroot.ssl.builtin import BuiltinSSLAdapter

          from MyFlaskApp import app

          my_app = WSGIPathInfoDispatcher('/': app)
          server = WSGIServer(('0.0.0.0', 443), my_app)

          ssl_cert = "[path]/myapp.crt"
          ssl_key = "[path]/myapp.key"
          server.ssl_adapter = BuiltinSSLAdapter(ssl_cert, ssl_key, None)

          if __name__ == '__main__':
          try:
          server.start()
          except KeyboardInterrupt:
          server.stop()





          share|improve this answer















          I figured out the necessary modification.
          Not much information on Flask app on Cheroot with https, so I thought I'd share it.



          from cheroot.wsgi import Server as WSGIServer
          from cheroot.wsgi import PathInfoDispatcher as WSGIPathInfoDispatcher
          from cheroot.ssl.builtin import BuiltinSSLAdapter

          from MyFlaskApp import app

          my_app = WSGIPathInfoDispatcher('/': app)
          server = WSGIServer(('0.0.0.0', 443), my_app)

          ssl_cert = "[path]/myapp.crt"
          ssl_key = "[path]/myapp.key"
          server.ssl_adapter = BuiltinSSLAdapter(ssl_cert, ssl_key, None)

          if __name__ == '__main__':
          try:
          server.start()
          except KeyboardInterrupt:
          server.stop()






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 27 at 0:53

























          answered Mar 26 at 23:37









          KayKay

          11810 bronze badges




          11810 bronze badges















          • AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

            – webKnjaZ
            Apr 1 at 12:23











          • Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

            – webKnjaZ
            Apr 1 at 12:24

















          • AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

            – webKnjaZ
            Apr 1 at 12:23











          • Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

            – webKnjaZ
            Apr 1 at 12:24
















          AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

          – webKnjaZ
          Apr 1 at 12:23





          AFAIR you could even omit my_app = WSGIPathInfoDispatcher('/': app) line and feed app to the WSGI server directly.

          – webKnjaZ
          Apr 1 at 12:23













          Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

          – webKnjaZ
          Apr 1 at 12:24





          Oh and hey here's an obligatory reminder about Python 2.7 EOL: pythonclock.org

          – webKnjaZ
          Apr 1 at 12:24








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366395%2fhow-to-run-a-flask-app-on-cherrypy-wsgi-server-cheroot-using-https%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript