# HTTPS in Java with a self-signed certificate

DevFeed: [HTTPS in Java with a self-signed certificate](<https://devfeed.tech/articles/https-in-java-with-a-self-signed-certificate-26069.md>)

Original publisher: [Read original article](<https://blog.arkey.fr/2017/10/19/self-signed-certificates-in-java.en/>)

Author: brice.dutheil@gmail.com (Brice Dutheil)

Published: 2017-10-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [The Coffee Workshop](<https://devfeed.tech/sources/the-coffee-workshop.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [SSL](<https://devfeed.tech/topics/ssl.md>), [TLS (Transport Layer Security)](<https://devfeed.tech/topics/tls.md>), [certificates](<https://devfeed.tech/topics/certificates.md>), [Security](<https://devfeed.tech/topics/security.md>), [test](<https://devfeed.tech/topics/test.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [certificates](<https://devfeed.tech/tags/certificates.md>), [exception](<https://devfeed.tech/tags/exception.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [https](<https://devfeed.tech/tags/https.md>), [java](<https://devfeed.tech/tags/java.md>), [security](<https://devfeed.tech/tags/security.md>), [ssl](<https://devfeed.tech/tags/ssl.md>), [tls](<https://devfeed.tech/tags/tls.md>)

## AI overview

This tutorial explains why a Java HTTPS client rejects a WireMock server using a self-signed certificate. It introduces the SSL/TLS and PKIX trust-chain concepts involved and discusses generating and controlling certificates in test environments.

## Source excerpt

Your application should connect to an HTTPS server, usually that's a no brainer, however as good software craft-man, you may think how do I test this code to make nothing has been forgotten.