{"id":15655587,"url":"https://github.com/nepitwin/rabbitssl","last_synced_at":"2025-04-15T01:29:00.762Z","repository":{"id":164521466,"uuid":"110823412","full_name":"Nepitwin/RabbitSSL","owner":"Nepitwin","description":"Example Java, Spring-Boot and Python RabbitMQ SSL configuration","archived":false,"fork":false,"pushed_at":"2024-09-06T12:47:10.000Z","size":183,"stargazers_count":26,"open_issues_count":0,"forks_count":19,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T13:21:21.888Z","etag":null,"topics":["java","python","rabbitmq","spring-boot","ssl","tls"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nepitwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-15T11:12:51.000Z","updated_at":"2024-09-06T12:47:13.000Z","dependencies_parsed_at":"2024-10-23T04:57:20.914Z","dependency_job_id":null,"html_url":"https://github.com/Nepitwin/RabbitSSL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nepitwin%2FRabbitSSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nepitwin%2FRabbitSSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nepitwin%2FRabbitSSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nepitwin%2FRabbitSSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nepitwin","download_url":"https://codeload.github.com/Nepitwin/RabbitSSL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248988423,"owners_count":21194417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","python","rabbitmq","spring-boot","ssl","tls"],"created_at":"2024-10-03T12:59:54.956Z","updated_at":"2025-04-15T01:29:00.744Z","avatar_url":"https://github.com/Nepitwin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RabbitMQ - SSL Example\n\nSSL-Example for Python and Java Clients from https://www.rabbitmq.com/ssl.html.\n\n## Docker - RabbitMQ-Server\n\nSimple use docker-compose to create a docker rabbitmq container with ssl support.\n\n```\ncd Docker\ndocker-compose up\n```\n\n## RabbitMQ-Server Certificates\n\n### SSL Certificate Generation\n\nRabbitmq ssl-tutorial --\u003e https://www.rabbitmq.com/ssl.html\n\nUsing tls-gen's tool from michael klishin --\u003e https://github.com/michaelklishin/tls-gen\n\n```\ngit clone https://github.com/michaelklishin/tls-gen\ncd tls-gen/basic\n# private key password\nmake PASSWORD=bunnies\nmake verify\nmake info\n```\n\n```\nls -l ./result\n# Files generated in result folder\n--\u003e ca_certificate.pem\n--\u003e ca_key.pem\n--\u003e client_certificate.pem\n--\u003e client_key.p12\n--\u003e client_key.pem\n--\u003e server_certificate.pem\n--\u003e server_key.p12\n--\u003e server_key.pem\n```\n\n### Create a Java Keystore File\n\nhttps://docs.cloudera.com/documentation/enterprise/5-10-x/topics/cm_sg_openssl_jks.html\n\n```\ncd result\n\nkeytool.exe -importkeystore -srckeystore server_key.p12\n  -srcstoretype PKCS12 -srcstorepass bunnies \n  -deststorepass bunnies -destkeypass password \n  -destkeystore server_store.jks\n```\n\n\n### SSL Certificate Setup\n\nCopy /Certificates/testca/cacert.pem, /Certificates/server/key.pem and /Certificates/server/cert.pem to /etc/ssl/rabbit/ to setup certificate example files to establish a RabbitMQ-TLS connection.\n\n```\ncd /etc/ssl/\nmkdir rabbit\ncd \u003cGIT_Project_PATH\u003e\ncp /Certificates/testca/cacert.pem /etc/ssl/rabbit/cacert.pem\ncp /Certificates/server/cert.pem /etc/ssl/rabbit/cert.pem\ncp /Certificates/server/key.pem /etc/ssl/rabbit/key.pem\n```\n\n### SSL-Configuration\n\nCopy this example file for RabbiMQ and restart service.\n\nOld syntax by rabbitmq.config\n\n```\n[\n  {rabbit, [\n     {ssl_listeners, [5671]},\n     {ssl_options, [{cacertfile,\"/etc/ssl/rabbit/cacert.pem\"},\n                    {certfile,\"/etc/ssl/rabbit/cert.pem\"},\n                    {keyfile,\"/etc/ssl/rabbit/key.pem\"},\n                    {verify,verify_peer},\n                    {fail_if_no_peer_cert,true}]}\n   ]}\n].\n```\n\nNew syntax by rabbitmq.conf\n\n```\nlisteners.tcp = none\nlisteners.ssl.default = 5671\n\nssl_options.cacertfile           = /etc/ssl/rabbit/ca_certificate.pem\nssl_options.certfile             = /etc/ssl/rabbit/server_certificate.pem\nssl_options.keyfile              = /etc/ssl/rabbit/server_key.pem\nssl_options.verify               = verify_peer\nssl_options.fail_if_no_peer_cert = true\n```\n\n## Execute Examples\n\nUse Java (Gradle) or Python examples to execute examples.\n\n### Python\n\nPython client is split up for a consumer (rabitssl_consume.py) and producer (rabitssql_send.py). Producer sends a message to RabbitMQ-Server and consumer receives this message. PIKA is needed to establish connections.\n\n```\ncd Python\npython rabitssql_consume.py/rabitssql_send.py\n```\n\n### Java\n\nJava client sends and receives message from a single main file. Simple use Gradle to build and run example.\n\n```\ncd Java\ngradle run\n```\n\n## Spring-Boot-amqp\n\nRabbitMQ-SSL Spring-Boot example can be build and executed to use Gradle. Clients sends by\nscheduled task every 5 seconds a sample message.\n\n```\ncd Spring\ngradle bootRun\n```\n\n## License\n\nCopyright 2017-2018 Andreas Sekulski\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnepitwin%2Frabbitssl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnepitwin%2Frabbitssl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnepitwin%2Frabbitssl/lists"}