It's difficult to tell in what cases the same error class would be raised for a different reason. The source code shows several instances where this error class is raised, but it's difficult to tell what each error case is (or what error message is given) without diving deeper into openssl.

The error message is not localized, it is hardcoded into OpenSSL:

```
ddeleo@lorentz openssl-1.0.1e > grep -n 'cert already in hash table' -r .
./crypto/x509/x509_err.c:126:{ERR_REASON(X509_R_CERT_ALREADY_IN_HASH_TABLE),"cert already in hash table"},
```

I agree it would be vastly better to check if the cert store contains the certificate ahead of time, but I don't think this is possible. The documentation is poor, but none of the method names indicate that an operation like this is possible: http://www.ruby-doc.org/stdlib-2.0.0/libdoc/openssl/rdoc/OpenSSL/X509/Store.html I also checked `OpenSSL::X509::Store.new.methods` to see if there were any extra methods that did not show up in the docs, but I didn't find anything.