LocalRepoKeyStore.setupHTTPSCertificate() handles all exceptions itself
Since there is nothing happening with the Exceptions anyway, they should be handled in this method so that this method is easy to use elsewhere.
This commit is contained in:
parent
d5488fc5f1
commit
b70986ef16
@ -133,24 +133,25 @@ public class LocalRepoKeyStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupHTTPSCertificate() throws CertificateException,
|
public void setupHTTPSCertificate() {
|
||||||
OperatorCreationException, KeyStoreException, NoSuchAlgorithmException,
|
try {
|
||||||
FileNotFoundException, IOException, UnrecoverableKeyException {
|
// Get the existing private/public keypair to use for the HTTPS cert
|
||||||
// Get the existing private/public keypair to use for the HTTPS cert
|
KeyPair kerplappKeypair = getKerplappKeypair();
|
||||||
KeyPair kerplappKeypair = getKerplappKeypair();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Once we have an IP address, that can be used as the hostname. We can
|
* Once we have an IP address, that can be used as the hostname. We
|
||||||
* generate a self signed cert with a valid CN field to stash into the
|
* can generate a self signed cert with a valid CN field to stash
|
||||||
* keystore in a predictable place. If the IP address changes we should
|
* into the keystore in a predictable place. If the IP address
|
||||||
* run this method again to stomp old HTTPS_CERT_ALIAS entries.
|
* changes we should run this method again to stomp old
|
||||||
*/
|
* HTTPS_CERT_ALIAS entries.
|
||||||
X500Name subject = new X500Name("CN=" + FDroidApp.ipAddressString);
|
*/
|
||||||
|
X500Name subject = new X500Name("CN=" + FDroidApp.ipAddressString);
|
||||||
Certificate indexCert = generateSelfSignedCertChain(kerplappKeypair, subject,
|
Certificate indexCert = generateSelfSignedCertChain(kerplappKeypair, subject,
|
||||||
FDroidApp.ipAddressString);
|
FDroidApp.ipAddressString);
|
||||||
|
addToStore(HTTP_CERT_ALIAS, kerplappKeypair, indexCert);
|
||||||
addToStore(HTTP_CERT_ALIAS, kerplappKeypair, indexCert);
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getKeyStoreFile() {
|
public File getKeyStoreFile() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user