Fix certificate error on mac

This fix should be validated on windows and linux