don't do an assignment inside if()

Signed-off-by: Lehner Florian <dev@der-flo.net>
improve way of checking the certs

Signed-off-by: Lehner Florian <dev@der-flo.net>