printf("NSS: [%p] ForceHandshake failure -- error %d\n", (void*)fd, PR_GetError());
PR_LOG(gPIPNSSLog, PR_LOG_ERROR, ("[%p] ForceHandshake failure -- error %d\n", (void*)fd, PR_GetError()));
nsSSLIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr,                    PRIntervalTime timeout){  if (!fd || !addr)    return PR_FAILURE;    PRStatus status = PR_SUCCESS;    // Due to limitations in NSPR 4.0, we must execute this entire connect  // as a blocking operation.    PRSocketOptionData sockopt;  sockopt.option = PR_SockOpt_Nonblocking;  PR_GetSocketOption(fd, &sockopt);    PRBool nonblock = sockopt.value.non_blocking;  sockopt.option = PR_SockOpt_Nonblocking;  sockopt.value.non_blocking = PR_FALSE;  PR_SetSocketOption(fd, &sockopt);    nsNSSSocketInfo* infoObject = (nsNSSSocketInfo*) fd->secret;    status = fd->lower->methods->connect(fd->lower, addr,                                        PR_INTERVAL_NO_TIMEOUT);  if (status != PR_SUCCESS) {    printf("NSS: [%p] lower layer connect error: %d\n", (void*)fd,           PR_GetError());    goto loser;  }    PRBool forceHandshake, useTLS;  infoObject->GetForceHandshake(&forceHandshake);  infoObject->GetUseTLS(&useTLS);#ifdef DEBUG_SSL  printf("NSS: [%p] Connect: forceHandshake = %d, useTLS = %d\n", (void*)fd,         forceHandshake, useTLS);#endif    if (!useTLS && forceHandshake) {    PRInt32 res = SSL_ForceHandshake(fd);        if (res == -1) {      printf("NSS: [%p] ForceHandshake failure -- error %d\n", (void*)fd,             PR_GetError());      status = PR_FAILURE;    }  } loser:  sockopt.option = PR_SockOpt_Nonblocking;  sockopt.value.non_blocking = nonblock;  PR_SetSocketOption(fd, &sockopt);    return status;}