Giter Club home page Giter Club logo

Comments (5)

kllr avatar kllr commented on July 18, 2024

One step further;

Added this:

@app.route('/.well-known/acme-challenge/path:filename', methods=['GET','POST'])
async def send_certbot_challenge(filename):
if request.method == 'GET':
return await send_from_directory('./.well-known/acme-challenge/', filename)

When i run the server:
hypercorn --bind ec2-18-222-XXX-XXX.us-east-2.compute.amazonaws.com:80 vote:app
and then:
sudo certbot certonly --webroot -w /home/ubuntu/vote -d sitename.nl
the certificate installs...

But now i still get a timeout running the site.
I kill the server on port 80, and then restart it like this:
hypercorn --bind ec2-18-222-XXX-XXX.us-east-2.compute.amazonaws.com:**443** vote:app

Still running with port 80 gives a working site on http. The ports (ec2 security group) 80 and 443 are open to all IP's. This security group is also used for the flask/apache project, and works there for https.
Any suggestions??

from quart.

kllr avatar kllr commented on July 18, 2024

hypercorn --certfile /etc/letsencrypt/csr/0006_csr-certbot.pem --keyfile /etc/letsencrypt/keys/0006_key-certbot.pem --bind ec2-18-222-xxx-xxx.us-east-2.compute.amazonaws.com:443 vote:app

Tried this as well but this gives error:
SSLError: [SSL] PEM lib (_ssl.c:3717)


hypercorn/config.py in create_ssl_context at line 107
        try:
            context.set_npn_protocols(["h2", "http/1.1"])
        except NotImplementedError:
            pass  # NPN is not necessarily available
        context.load_cert_chain(certfile=self.certfile, keyfile=self.keyfile)
        if self.ca_certs is not None:
            context.load_verify_locations(self.ca_certs)
        return context

from quart.

pgjones avatar pgjones commented on July 18, 2024

I'm not familiar with certbot, but you seem to have that working. The SSLError seems to suggest it has an issue with the keyfile, are you sure /etc/letsencrypt/keys/0006_key-certbot.pem is the private key? This could be the relevant answer.

from quart.

kllr avatar kllr commented on July 18, 2024

Hi,

Thanks!! You were totally right. Sorry for wasting your precious time.

hypercorn --certfile /etc/letsencrypt/live/sitename.nl/cert.pem --keyfile /etc/letsencrypt/live/sitename.nl/privkey.pem --bind ec2-18-222-xxx-xxx.us-east-2.compute.amazonaws.com:443 vote:app

This did the trick. All is running very well :)

from quart.

pgjones avatar pgjones commented on July 18, 2024

Great, I'm glad you figured it out.

from quart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.