lib: support ECDHE