milestone: client uses provided certificate

also includes bugfixes for server part