TL;DR: Is it possible to have both sides of a SSL/TLS connection have the same public and private key, so long as that public key is trusted by both sides?
More info if helpful:
I'm trying to test how I'd setup having Java application connecting to Kafka 2.1. I am using the same keystore and truststore for the Kafka cluster and the Java application, meaning both sides of the connection have the same public and private key. I understand this is not good practice, I just wanted to verify I understood how to configure things.
I can set
listeners=PLAINTEXT://localhost:9092,SSL://localhost:9093
# This is the config style for 2.3
# listeners=HTTP://localhost:9092,HTTPS://localhost:9093
ssl.keystore.location=/path/to/kafka.keystore.jks
ssl.keystore.password=test
ssl.truststore.location: /path/to/kafka.truststore.jks
ssl.truststore.password: test
ssl.key.password=test
a bunch of properties in Kafka to enable TLS/SSL authentication. I feel confident that I've made the truststore and keystore correctly, where the truststore contains the 1 public key that the java side and the kafka side are using. I've done the same on the java side, roughly following a GitHub example.
I can't get any connection going, and I am trying to remove possibilities for why. Could this be because both sides of the connection have the same public and private key?