1) Create a private key + certificate for the server in a new key store:

keytool -genkey -alias test-store -keyalg RSA -keystore server-keystore.jks -keysize 2048

2) Export the cert from the store

keytool -export -alias test-store -file localhost.crt -keystore server-keystore.jks

3) Import the cert into a new trust-store for the client

keytool -import -trustcacerts -alias test-store -file localhost.crt -keystore client-truststore.jks