User Tools

Site Tools


doc:appunti:linux:sa:cacti_122

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
doc:appunti:linux:sa:cacti_122 [2019/09/06 15:09] – [Porta TCP alternativa per servizio standard] niccolodoc:appunti:linux:sa:cacti_122 [2019/09/06 16:06] – [VirtualHost con SSL] niccolo
Line 595: Line 595:
 ===== VirtualHost con SSL ===== ===== VirtualHost con SSL =====
  
 +Per monitorare il funzionamento basico di un server web è sufficiente definire una variabile **vars.http_vhosts** in una sezione **object Host**:
  
 +<file>
 +object Host "ServerName" {
 +  import "generic-host"
 +  address = "servername.rigacci.org"
 +  vars.http_vhosts["www.rigacci.org"] = { }
 +}
 +</file>
 +
 +Il nome tra parentesi quadre è solo una label utilizzata per identificare il servizio nell'interfaccia web, non viene utilizzata né per ottenere l'indirizzo IP del server (a quello serve la variabile **address**) né tantomeno per identificare un //NamedVirtualHost//.
 +
 +Per un moderno server web tuttavia è necessario verificare la scadenza del certificato SSL ed eventualmente verificare diversi **VirtualHost** che condividono lo stesso indirizzo IP, ma hanno **ServerName** e **certificati SSL** diversi.
 +
 +In teoria non sarebbe possibile **verificare il certificato SSL di un VirtualHost basato su nome**, perché nella fase iniziale della negoziazione SSL il nome dell'host richiesto non è ancora noto e quindi il server non può sapere quale certificato presentare al client. Tuttavia l'estensione SNI è stata sviluppata apposta per ovviare a questo problema. Vedere in proposito **[[https://cwiki.apache.org/confluence/display/httpd/NameBasedSSLVHostsWithSNI|Name Based SSL VHosts With SNI]]**.
 +
 +Ammettendo che il server web sia configurato opportunamente, ecco un modo per verificare due diversi VirtualHost ospitati sullo stesso server:
 +
 +<file>
 +object Host "ServerName" {
 +  import "generic-host"
 +  address = "servername.rigacci.org"
 +  vars.http_vhosts["www.first_domain.tld"] = {
 +    http_address = "$address$"
 +    http_vhost = "www.first_domain.tld"
 +    http_ssl = true
 +    http_sni = true
 +    http_certificate = "24,14"
 +  }
 +  vars.http_vhosts["www.second_domain.tld"] = {
 +    http_address = "$address$"
 +    http_vhost = "www.second_domain.tld"
 +    http_ssl = true
 +    http_sni = true
 +    http_certificate = "24,14"
 +  }
 +}
 +</file>
 +
 +Each **vars.http_vhosts** section correspond to one command invokation, of this type:
 +
 +<code>
 +check_http -H "www.first_domain.tld" -I "servername.rigacci.org" -S --sni -C "24,14"
 +</code>
  
 ===== Riferimenti Web ===== ===== Riferimenti Web =====
doc/appunti/linux/sa/cacti_122.txt · Last modified: 2022/10/10 16:27 by niccolo