add ssl share lock

Signed-off-by: xiehuc <xiehuc@gmail.com>
fix a logic error

Signed-off-by: xiehuc <xiehuc@gmail.com>
fix some crash

Signed-off-by: xiehuc <xiehuc@gmail.com>