{"action":"closed","issue":{"url":"https://api.github.com/repos/cesanta/fossa/issues/310","labels_url":"https://api.github.com/repos/cesanta/fossa/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/cesanta/fossa/issues/310/comments","events_url":"https://api.github.com/repos/cesanta/fossa/issues/310/events","html_url":"https://github.com/cesanta/fossa/issues/310","id":105286368,"number":310,"title":"wrong example, restful_server","user":{"login":"MaxSurtaev","id":14171486,"avatar_url":"https://avatars.githubusercontent.com/u/14171486?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxSurtaev","html_url":"https://github.com/MaxSurtaev","followers_url":"https://api.github.com/users/MaxSurtaev/followers","following_url":"https://api.github.com/users/MaxSurtaev/following{/other_user}","gists_url":"https://api.github.com/users/MaxSurtaev/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxSurtaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxSurtaev/subscriptions","organizations_url":"https://api.github.com/users/MaxSurtaev/orgs","repos_url":"https://api.github.com/users/MaxSurtaev/repos","events_url":"https://api.github.com/users/MaxSurtaev/events{/privacy}","received_events_url":"https://api.github.com/users/MaxSurtaev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-08T02:05:02Z","updated_at":"2015-09-25T15:22:52Z","closed_at":"2015-09-25T15:22:52Z","body":"In restful_server example \r\nif option NS_ENABLE_SSL is set\r\n\r\n```\r\nns_set_ssl(nc, ssl_cert, NULL);\r\n```\r\ngoes before \r\n```\r\nnc = ns_bind(&mgr, s_http_port, ev_handler);\r\n```\r\n\r\nthat makes using SSL in that example impossible\r\n\r\nthe way how I compile it\r\n```\r\nbash-3.2$ export SSL=openssl\r\nbash-3.2$ make\r\ncc restful_server.c ../../fossa.c -o restful_server -W -Wall -I../..  -DNS_ENABLE_SSL -lssl -lcrypto -lcrypto\r\nrestful_server.c:80:40: warning: variable 'nc' is uninitialized when used here [-Wuninitialized]\r\n      const char *err_str = ns_set_ssl(nc, ssl_cert, NULL);\r\n                                       ^~\r\nrestful_server.c:51:27: note: initialize the variable 'nc' to silence this warning\r\n  struct ns_connection *nc;\r\n                          ^\r\n                           = NULL\r\n1 warning generated.\r\nbash-3.2$ ./restful_server \r\nStarting RESTful server on port 8000\r\n\r\n\r\n```\r\n\r\nthe server runs as HTTP server and does not respond on HTTPS request. Even compiler complains about it in restful_server.c:80:40"}}