Fix load certificate for Server API.

Use raw SQL instead of ORM because changes on database schema are
not yet available.