OpenKMIP / PyKMIP

A Python implementation of the KMIP specification.
Apache License 2.0
272 stars 134 forks source link

Not able to spin a server on 127.0.0.1:5696 #648

Closed negiganga closed 3 years ago

negiganga commented 3 years ago
  1. I installed pykmip using pip command, and then created a file "/etc/pykmip/server.conf" with below configuration: [server] hostname=127.0.0.1 port=5696 certificate_path=/etc/pykmip/certs/server_cert.pem key_path=/etc/pykmip/certs/server_private_key.pem ca_path=/etc/pykmip/certs/server_ca_cert.crt auth_suite=Basic policy_path=/..../policies enable_tls_client_auth=True logging_level=INFO tls_cipher_suites= TLS_RSA_WITH_AES_128_CBC_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 database_path=/tmp/pykmip.db I used the "create_certificates.py" for generating server/client certs. then, I ran "pykmip-server" command but nothing happened (no logs, nothing)

  2. I cloned the repo and then build it locally using "python pykmip/setup.py install", and then ran "python bin/run_server.py". Though I see some logs in server.log file this time but there is no port running on 5696, and hence client is getting timeout. Logs: 2021-06-03 15:31:01,633 - kmip.server.config - INFO - Loading server configuration settings from: /etc/pykmip/server.conf 2021-06-03 15:31:01,656 - kmip.server.monitor - INFO - Starting up the operation policy file monitor. 2021-06-03 15:31:01,669 - kmip.server - INFO - Starting server socket handler. 2021-06-03 15:31:01,672 - kmip.server - INFO - Server successfully bound socket handler to 127.0.0.1:5696 2021-06-03 15:31:01,672 - kmip.server - INFO - Starting connection service... 2021-06-03 15:31:02,659 - kmip.server.monitor - INFO - Loading policies for file: /...../policies/policy.json 2021-06-03 15:31:02,662 - kmip.server.monitor - INFO - Loading policy: example

Am I missing some configurations? Any help would be highly appreciated. Thanks in advance.

PeterHamilton commented 3 years ago

Hi @negiganga, thanks for filing this issue. For (1), when you run pykmip-server on the CLI do you see any output or error at all? I'm trying to determine if the pykmip-server entry point is actually recognized by your shell or if it doesn't exist at all.

For (2), those logs look correct to me. When you connect to the server with a client, you should see log messages like this:

<timestamp> - kmip.server - INFO - Starting connection service...
<timestamp> - kmip.server - INFO - Receiving incoming connection from: <ip>:<port>
<timestamp> - kmip.server - INFO - Dedicating session <id> to <ip>:<port>
<timestamp> - kmip.server - INFO - Starting session: <id>

Do you have logs or error output from the client when you try to connect to the server?

negiganga commented 3 years ago

Never mind, I tried everything again, and then it worked, not sure what was missing earlier. I followed the same steps.

And, I would like to appreciate your prompt response and also having this jar to simulate KMIP compliant server. Your documentation is great.

PeterHamilton commented 3 years ago

@negiganga That's great to hear! I'm glad everything's working now. I'm not always as prompt as I'd like to be but thank you for your kind words. If you need anything else just let me know. I'll close this issue for now.