SNIA / Swordfish-API-Emulator

The Swordfish API Emulator can emulate a Swordfish-based system statically or dynamically. Starting from an initial state described by mock-ups, the emulator can be used to emulate a Swordfish system responding to create/modify/delete operations in order to allow developers to model new Swordfish functionality, test clients, demonstrate Swordfish and other similar functions.
Other
22 stars 20 forks source link

server.crt and server.key missing #97

Closed tmakatos closed 1 year ago

tmakatos commented 1 year ago

Followed instructions and it fails with:

Traceback (most recent call last):
  File "emulator.py", line 617, in <module>
    main()
  File "emulator.py", line 613, in main
    g.app.run(**kwargs)
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/flask/app.py", line 920, in run
    run_simple(t.cast(str, host), port, self, **options)
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 1017, in run_simple
    inner()
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 966, in inner
    fd=fd,
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 790, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 709, in __init__
    ssl_context = load_ssl_context(*ssl_context)
  File "/home/thanos.makatos/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 602, in load_ssl_context
    ctx.load_cert_chain(cert_file, pkey_file)
FileNotFoundError: [Errno 2] No such file or directory

I don't see server.crt and server.key anywhere. Setting "AUTHENTICATION": "Disable" in emulator-config.json works around this.

FWIW this is on Linux.

rahlvers commented 1 year ago

With the addition of https, secure authentication and sessions, certificates and keys are required. Details to enable are documented here: https://github.com/SNIA/Swordfish-API-Emulator/blob/master/Documentation/Self%20signed%20certificate%20and%20key%20generation%20guide.docx

This has been included as part of the setup.sh script as well, if you use that. Need to add additional notes to README.

rahlvers commented 1 year ago

Additional info has been added to README.