merging SSL API code