Programmatically adding a trusted cert in Java

前端 未结 3 2000
太阳男子
太阳男子 2021-02-15 01:47

I use SSL to communicate between two components written in Java. I can\'t use a CA, so I have to self-sign everything. Unfortunately, this means that when I try to handshake, I

3条回答
  •  野性不改
    2021-02-15 02:29

    Yes it is possible.

    There is some code here that I've used before. I had to modify it to do what I wanted and I suspect that you will too but this should get you close - you aren't trying to import a key so theoretically you should be able to simplify things. In any case you can get an idea of what you'll need.

    The JDK JavaDoc for java.security.KeyStore is pretty useful too.

提交回复
热议问题