fprintf(stderr, "Can't find certificate %s\n", fNickName);
fprintf(stderr, "selfserv: Can't find certificate %s\n", fNickName);
main(int argc, char **argv){    char *               progName    = NULL;    char *               nickName    = NULL;    char *               fNickName   = NULL;    char *               fileName    = NULL;    char *               cipherString= NULL;    char *               dir         = ".";    char *               passwd      = NULL;    char *		 pidFile    = NULL;    char *               tmp;    CERTCertificate *    cert   [kt_kea_size] = { NULL };    SECKEYPrivateKey *   privKey[kt_kea_size] = { NULL };    int                  requestCert = 0;    unsigned short       port        = 0;    SECStatus            rv;    PRBool               useExportPolicy = PR_FALSE;    PLOptState *optstate;    tmp = strrchr(argv[0], '/');    tmp = tmp ? tmp + 1 : argv[0];    progName = strrchr(tmp, '\\');    progName = progName ? progName + 1 : tmp;    optstate = PL_CreateOptState(argc, argv, "RT2:3c:d:p:mn:i:f:rvw:x");    while (PL_GetNextOpt(optstate) == PL_OPT_OK) {	switch(optstate->option) {	default:	case '?': Usage(progName); 		break;	case '2': fileName = optstate->value; 	break;	case '3': disableSSL3 = PR_TRUE;	break;	case 'R': disableRollBack = PR_TRUE;	break;	case 'T': disableTLS  = PR_TRUE;	break;        case 'c': cipherString = strdup(optstate->value); break;	case 'd': dir = optstate->value; 	break;	case 'f': fNickName = optstate->value; 	break;        case 'm': useModelSocket = PR_TRUE; 	break;        case 'n': nickName = optstate->value; 	break;        case 'i': pidFile = optstate->value; 	break;	case 'p': port = PORT_Atoi(optstate->value); break;	case 'r': ++requestCert; 		break;        case 'v': verbose++; 			break;	case 'w': passwd = optstate->value;	break;        case 'x': useExportPolicy = PR_TRUE; 	break;	}    }    if ((nickName == NULL) && (fNickName == NULL))	Usage(progName);    if (port == 0)	Usage(progName);    if (pidFile) {	FILE *tmpfile=fopen(pidFile,"w+");	if (tmpfile) {	    fprintf(tmpfile,"%d",getpid());	    fclose(tmpfile);        }    }	    /* Call the NSPR initialization routines */    PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);    if (fileName)    	readBigFile(fileName);    /* set our password function */    PK11_SetPasswordFunc( passwd ? ownPasswd : SECU_GetModulePassword);    /* Call the libsec initialization routines */    rv = NSS_Init(dir);    if (rv != SECSuccess) {    	fputs("NSS_Init failed.\n", stderr);	exit(1);    }    /* set the policy bits true for all the cipher suites. */    if (useExportPolicy)	NSS_SetExportPolicy();    else	NSS_SetDomesticPolicy();    /* all the SSL2 and SSL3 cipher suites are enabled by default. */    if (cipherString) {    	int ndx;	/* disable all the ciphers, then enable the ones we want. */	disableSSL2Ciphers();	disableSSL3Ciphers();	while (0 != (ndx = *cipherString++)) {	    int *cptr;	    int  cipher;	    if (! isalpha(ndx))	     	Usage(progName);	    cptr = islower(ndx) ? ssl3CipherSuites : ssl2CipherSuites;	    for (ndx &= 0x1f; (cipher = *cptr++) != 0 && --ndx > 0; ) 	    	/* do nothing */;	    if (cipher) {		SECStatus status;		status = SSL_CipherPrefSetDefault(cipher, SSL_ALLOWED);		if (status != SECSuccess) 		    SECU_PrintError(progName, "SSL_CipherPrefSet()");	    }	}    }    if (nickName) {	cert[kt_rsa] = PK11_FindCertFromNickname(nickName, passwd);	if (cert[kt_rsa] == NULL) {	    fprintf(stderr, "Can't find certificate %s\n", nickName);	    exit(1);	}	privKey[kt_rsa] = PK11_FindKeyByAnyCert(cert[kt_rsa], passwd);	if (privKey[kt_rsa] == NULL) {	    fprintf(stderr, "Can't find Private Key for cert %s\n", nickName);	    exit(1);	}    }    if (fNickName) {	cert[kt_fortezza] = PK11_FindCertFromNickname(fNickName, NULL);	if (cert[kt_fortezza] == NULL) {	    fprintf(stderr, "Can't find certificate %s\n", fNickName);	    exit(1);	}	privKey[kt_fortezza] = PK11_FindKeyByAnyCert(cert[kt_fortezza], NULL);    }    rv = SSL_ConfigMPServerSIDCache(256, 0, 0, NULL);    if (rv != SECSuccess) {        errExit("SSL_ConfigMPServerSIDCache");    }    server_main(port, requestCert, privKey, cert);    NSS_Shutdown();    PR_Cleanup();    return 0;}