I have a `JKS` file which was generated using a password. I have a java code that uses that `keystore` to connect to a url. Now when I load the keystore, I had mistakenly passed the *password* as `null`. But to my amazement, the connection still went through.

```
KeyStore store = KeyStore.getInstance("JKS");
store.load(stream, null);

```

This kind of behavior looked suspicious to me. Is there an explanation for this?

**EDIT:**

If this behavior is as expected, then why is the passphrase required when creating a keystore via keytool?