You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
emmett develop --ssl-certfile cert.pem --ssl-keyfile key.pem
> Starting Emmett development server on app app
> Emmett application app running on http://127.0.0.1:8000 (press CTRL+C to quit)
> Restarting (stat mode)
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/emmett_core/server.py", line 28, in run
server = granian.Granian(
^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/granian/server.py", line 153, in __init__
self.build_ssl_context(ssl_cert, ssl_key, ssl_key_password)
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/granian/server.py", line 175, in build_ssl_context
self.ssl_ctx = (True, str(cert.resolve()), str(key.resolve()), password)
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'resolve'
almost the same error when using the serve command:
emmett serve --ssl-certfile cert.pem --ssl-keyfile key.pem
Traceback (most recent call last):
File "/home/bbord/Projects/Various/Emmett/venv/bin/emmett", line 8, in<module>sys.exit(main())
^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/emmett/cli.py", line 473, in main
cli.main(prog_name="python -m emmett"if as_module else None)
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/emmett/cli.py", line 225, in main
returnsuper().main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/emmett/cli.py", line 322, in serve_command
sgi_run(
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/emmett_core/server.py", line 28, in run
server = granian.Granian(
^^^^^^^^^^^^^^^^
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/granian/server.py", line 153, in __init__
self.build_ssl_context(ssl_cert, ssl_key, ssl_key_password)
File "/home/bbord/Projects/Various/Emmett/venv/lib/python3.12/site-packages/granian/server.py", line 175, in build_ssl_context
self.ssl_ctx = (True, str(cert.resolve()), str(key.resolve()), password)
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'resolve'
I first thought it was an error with granian, but surprisingly, the following command worked as expected:
Hello there.
I'm giving a try to emmett and I had trouble using the SSL options with emmett.
It's a fresh install, as this pip freeze result shows:
app.py
file:When I launch this app using
emmett serve
oremmett develop
, there's no issue, the root route returns "Hello".But then I've generated a SSL cert+key using the command listed in the docs:
Now I've got my
key.pem
andcert.pem
files.But the next commands fail:
almost the same error when using the
serve
command:I first thought it was an error with granian, but surprisingly, the following command worked as expected:
Is there a bug in
emmett
? Is there something else to do on my side to enable ssl in dev/serve mode?The text was updated successfully, but these errors were encountered: