Lines Matching refs:vhost
81 struct lws_vhost *vhost;
108 struct lws_vhost *vhost;
112 * the vhd is allocated for every vhost using the plugin.
136 struct lws_vhost *vhost = lws_get_vhost(wsi);
137 struct acme_connection *ac = lws_vhost_user(vhost);
602 i->vhost = vh;
627 if (vhd->ac->vhost)
628 lws_vhost_destroy(vhd->ac->vhost);
674 lwsl_vhost_warn(vhd->vhost, "failed to create keypair");
681 lwsl_vhost_warn(vhd->vhost, "unable to save %s",
703 lwsl_vhost_notice(vhd->vhost, "ACME cert needs creating / updating: "
704 "vhost %s", lws_get_vhost_name(vhd->vhost));
735 vhd->ac->real_vh_port = lws_get_vhost_port(vhd->vhost);
736 vhd->ac->real_vh_name = lws_get_vhost_name(vhd->vhost);
737 vhd->ac->real_vh_iface = lws_get_vhost_iface(vhd->vhost);
739 lws_acme_report_status(vhd->vhost, LWS_CUS_STARTING, NULL);
742 lws_acme_report_status(vhd->vhost, LWS_CUS_CREATE_KEYS,
746 lws_acme_report_status(vhd->vhost, LWS_CUS_CREATE_KEYS,
750 if (lws_acme_client_connect(vhd->context, vhd->vhost,
799 vhd->vhost = lws_get_vhost(wsi);
882 lwsl_vhost_err(vhd->vhost, "unable to create update key file %s", buf);
904 * Somebody is telling us about a cert some vhost is using.
913 * ...is this a vhost we were configured on?
915 if (vhd->vhost != caa->vh)
946 lwsl_vhost_warn(vhd->vhost, "nonce too large");
965 lws_acme_report_status(vhd->vhost, LWS_CUS_REG, NULL);
968 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
971 lwsl_vhost_warn(vhd->vhost, "failed to connect to acme");
980 lwsl_vhost_warn(vhd->vhost, "no Location");
986 lwsl_vhost_warn(vhd->vhost, "Location too large");
992 lwsl_vhost_notice(vhd->vhost, "Location: %s", ac->acct_id);
999 lwsl_vhost_warn(vhd->vhost, "missing cert location");
1082 lwsl_vhost_warn(vhd->vhost, "could not add content type");
1090 lwsl_vhost_warn(vhd->vhost, "could not add content length");
1130 lwsl_vhost_notice(vhd->vhost, "Generating ACME CSR... may take a little while");
1138 lwsl_vhost_warn(vhd->vhost, "CSR generation failed");
1250 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1271 vhd->vhost, &ac->cwsi,
1297 lws_acme_report_status(vhd->vhost, LWS_CUS_AUTH,
1302 vhd->vhost, &ac->cwsi,
1315 lwsl_vhost_warn(vhd->vhost, "auth failed");
1318 lwsl_vhost_info(vhd->vhost, "chall: %s (%d)\n", ac->chall_token, ac->resp);
1320 lwsl_vhost_warn(vhd->vhost, "no challenge");
1325 lws_acme_report_status(vhd->vhost, LWS_CUS_CHALLENGE,
1341 lwsl_vhost_notice(vhd->vhost, "key_auth: '%s'", ac->key_auth);
1357 /* listen on the same port as the vhost that triggered us */
1360 /* make ourselves protocols[0] for the new vhost */
1364 * vhost .user points to the ac associated with the
1365 * temporary vhost
1369 ac->vhost = lws_create_vhost(lws_get_context(wsi),
1371 if (!ac->vhost)
1374 lwsl_vhost_notice(vhd->vhost, "challenge_uri %s", ac->challenge_uri);
1377 * The challenge-specific vhost is up... let the ACME
1381 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1386 lwsl_vhost_warn(vhd->vhost, "Connect failed");
1392 lwsl_vhost_notice(vhd->vhost, "COMPLETED start chall: %s",
1396 lws_acme_report_status(vhd->vhost, LWS_CUS_CHALLENGE,
1407 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1411 lwsl_vhost_warn(vhd->vhost, "failed to connect to acme");
1427 lwsl_vhost_warn(vhd->vhost, "Challenge failed");
1435 lwsl_vhost_notice(vhd->vhost, "ACME challenge passed");
1439 * temp vhost now its job is done
1441 if (ac->vhost)
1442 lws_vhost_destroy(ac->vhost);
1443 ac->vhost = NULL;
1452 lws_acme_report_status(vhd->vhost, LWS_CUS_REQ, NULL);
1456 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1460 lwsl_vhost_warn(vhd->vhost, "Failed to connect to acme");
1475 lwsl_vhost_warn(vhd->vhost, "Too many retries");
1481 vhd->vhost,
1485 lwsl_vhost_warn(vhd->vhost,
1497 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1501 lwsl_vhost_warn(vhd->vhost, "Failed to connect to acme");
1510 lwsl_vhost_warn(vhd->vhost, "Download cert failed on resp %d",
1514 lwsl_vhost_notice(vhd->vhost, "The cert was sent..");
1516 lws_acme_report_status(vhd->vhost, LWS_CUS_ISSUE, NULL);
1532 lwsl_vhost_err(vhd->vhost, "Unable to find ACME cert!");
1536 n = lws_plat_write_cert(vhd->vhost, 0,
1541 lwsl_vhost_err(vhd->vhost, "unable to write ACME cert! %d", n);
1549 if (lws_plat_write_cert(vhd->vhost, 1,
1553 lwsl_vhost_err(vhd->vhost, "unable to write ACME key!");
1560 lwsl_vhost_notice(vhd->vhost, "Updated certs written for %s "
1574 lwsl_vhost_warn(vhd->vhost, "problem setting certs");
1578 lws_acme_report_status(vhd->vhost,
1591 cwsi = lws_acme_client_connect(vhd->context, vhd->vhost,
1596 lwsl_vhost_warn(vhd->vhost, "Failed to connect");
1608 lwsl_vhost_warn(vhd->vhost, "Failed out");
1609 lws_acme_report_status(vhd->vhost, LWS_CUS_FAILED, failreason);