Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password is no longer mandatory #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/main/java/com/notnoop/apns/ApnsServiceBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public ApnsServiceBuilder withCert(String fileName, String password)
*/
public ApnsServiceBuilder withCert(InputStream stream, String password)
throws InvalidSSLConfig {
assertPasswordNotEmpty(password);
//assertPasswordNotEmpty(password);
return withSSLContext(
newSSLContext(stream, password,
KEYSTORE_TYPE, KEY_ALGORITHM));
Expand All @@ -196,17 +196,17 @@ public ApnsServiceBuilder withCert(InputStream stream, String password)
*/
public ApnsServiceBuilder withCert(KeyStore keyStore, String password)
throws InvalidSSLConfig {
assertPasswordNotEmpty(password);
//assertPasswordNotEmpty(password);
return withSSLContext(
newSSLContext(keyStore, password, KEY_ALGORITHM));
}

private void assertPasswordNotEmpty(String password) {
if (password == null || password.length() == 0) {
throw new IllegalArgumentException("Passwords must be specified." +
"Oracle Java SDK does not support passwordless p12 certificates");
}
}
// private void assertPasswordNotEmpty(String password) {
// if (password == null || password.length() == 0) {
// throw new IllegalArgumentException("Passwords must be specified." +
// "Oracle Java SDK does not support passwordless p12 certificates");
// }
// }

/**
* Specify the SSLContext that should be used to initiate the
Expand Down