fixed incorrect certificate length