Creare un certificato SSLCreate an SSL certificate
Questo articolo descrive come generare e installare certificati SSL (Secure Sockets Layer) per gli oggetti visivi di Power BI.This article describes how to generate and install Secure Sockets Layer (SSL) certificates for Power BI visuals.
Per le procedure di Windows, macOS X e Linux è necessario che sia installato il pacchetto pbiviz degli strumenti per oggetti visivi Power BI.For the Windows, macOS X, and Linux procedures, you must have the Power BI Visual Tools pbiviz package installed. Per altre informazioni, vedere Configurare l'ambiente per lo sviluppo di un oggetto visivo di Power BI.For more information, see Set up your environment for developing a Power BI visual.
Creare un certificato in WindowsCreate a certificate on Windows
Per generare un certificato usando il cmdlet New-SelfSignedCertificate
di PowerShell in Windows 8 o versione successiva, eseguire il comando seguente:To generate a certificate by using the PowerShell cmdlet New-SelfSignedCertificate
on Windows 8 and later, run the following command:
pbiviz --install-cert
Per Windows 7, lo strumento pbiviz
richiede che l'utilità OpenSSL sia disponibile dalla riga di comando.For Windows 7, the pbiviz
tool requires the OpenSSL utility to be available from the command line. Per installare OpenSSL, passare a OpenSSL o a OpenSSL Binaries (Distribuzioni binarie di OpenSSL).To install OpenSSL, go to OpenSSL or OpenSSL Binaries.
Per altre informazioni e istruzioni per l'installazione di un certificato, vedere Creare e installare un certificato per Windows.For more information and instructions for installing a certificate, see Create and install a certificate for Windows.
Creare un certificato in macOS XCreate a certificate on macOS X
L'utilità OpenSSL è in genere disponibile nel sistema operativo macOS X.The OpenSSL utility is usually available in the macOS X operating system.
È anche possibile installare l'utilità OpenSSL eseguendo uno dei due comandi seguenti:You can also install the OpenSSL utility by running either of the following commands:
Dall'utilità di gestione pacchetti Brew:From the Brew package manager:
brew install openssl brew link openssl --force
Usando MacPorts:By using MacPorts:
sudo port install openssl
Dopo aver installato l'utilità OpenSSL eseguire il comando seguente per generare un nuovo certificato:After you install the OpenSSL utility, run the following command to generate a new certificate:
pbiviz --install-cert
Per altre informazioni e istruzioni, vedere la scheda OSX in Creare e installare un certificato.For more information and instructions, see the OSX tab in Create and install a certificate.
Creare un certificato in LinuxCreate a certificate on Linux
L'utilità OpenSSL è in genere disponibile nel sistema operativo Linux.The OpenSSL utility is usually available in the Linux operating system.
Prima di iniziare, eseguire i comandi seguenti per assicurarsi che openssl
e certutil
siano installate:Before you begin, run the following commands to make sure openssl
and certutil
are installed:
which openssl
which certutil
Se openssl
e certutil
non sono installate, installare le utilità openssl
e libnss3
.If openssl
and certutil
aren't installed, install the openssl
and libnss3
utilities.
Creare il file di configurazione SSLCreate the SSL configuration file
Creare un file /tmp/openssl.cnf che include il testo seguente:Create a file called /tmp/openssl.cnf that contains the following text:
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[ alt_names ]
DNS.1=localhost
Generare l'autorità di certificazione radiceGenerate root certificate authority
Per generare l'autorità di certificazione radice (CA) per la firma dei certificati locali, eseguire i comandi seguenti:To generate root certificate authority (CA) to sign local certificates, run the following commands:
touch $HOME/.rnd
openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout /tmp/local-root-ca.key -out /tmp/local-root-ca.pem -subj "/C=US/CN=Local Root CA/O=Local Root CA"
openssl x509 -outform pem -in /tmp/local-root-ca.pem -out /tmp/local-root-ca.crt
Generare un certificato per localhostGenerate a certificate for localhost
Per generare un certificato per localhost
usando la CA generata e openssl.cnf, eseguire i comandi seguenti:To generate a certificate for localhost
using the generated CA and openssl.cnf, run the following commands:
PBIVIZ=`which pbiviz`
PBIVIZ=`dirname $PBIVIZ`
PBIVIZ="$PBIVIZ/../lib/node_modules/powerbi-visuals-tools/certs"
# Make sure that $PBIVIZ contains the correct certificate directory path. ls $PBIVIZ should list 'blank' file.
openssl req -new -nodes -newkey rsa:2048 -keyout $PBIVIZ/PowerBIVisualTest_private.key -out $PBIVIZ/PowerBIVisualTest.csr -subj "/C=US/O=PowerBI Visuals/CN=localhost"
openssl x509 -req -sha256 -days 1024 -in $PBIVIZ/PowerBIVisualTest.csr -CA /tmp/local-root-ca.pem -CAkey /tmp/local-root-ca.key -CAcreateserial -extfile /tmp/openssl.cnf -out $PBIVIZ/PowerBIVisualTest_public.crt
Aggiungere certificati radiceAdd root certificates
Per aggiungere un certificato radice al database del browser Chrome, eseguire:To add a root certificate to the Chrome browser's database, run:
certutil -A -n "Local Root CA" -t "CT,C,C" -i /tmp/local-root-ca.pem -d sql:$HOME/.pki/nssdb
Per aggiungere un certificato radice al database del browser Mozilla, eseguire:To add a root certificate to the Mozilla Firefox browser's database, run:
for certDB in $(find $HOME/.mozilla* -name "cert*.db")
do
certDir=$(dirname ${certDB});
certutil -A -n "Local Root CA" -t "CT,C,C" -i /tmp/local-root-ca.pem -d sql:${certDir}
done
Per aggiungere un certificato radice a livello di sistema, eseguire:To add a system-wide root certificate, run:
sudo cp /tmp/local-root-ca.pem /usr/local/share/ca-certificates/
sudo update-ca-certificates
Rimuovere i certificati radiceRemove root certificates
Per rimuovere un certificato radice, eseguire:To remove a root certificate, run:
sudo rm /usr/local/share/ca-certificates/local-root-ca.pem
sudo update-ca-certificates --fresh
Generare manualmente un certificatoGenerate a certificate manually
È anche possibile generare manualmente un certificato SSL usando OpenSSL.You can also generate an SSL certificate manually using OpenSSL. È possibile specificare qualsiasi strumento per generare i certificati.You can specify any tools to generate your certificates.
Se l'utilità OpenSSL è già installata, generare un nuovo certificato eseguendo:If the OpenSSL utility is already installed, generate a new certificate by running:
openssl req -x509 -newkey rsa:4096 -keyout PowerBIVisualTest_private.key -out PowerBIVisualTest_public.crt -days 365
In genere è possibile trovare i certificati del server Web PowerBI-visuals-tools
eseguendo uno dei comandi seguenti:You can usually find the PowerBI-visuals-tools
web server certificates by running one of the following commands:
Per l'istanza globale degli strumenti:For the global instance of the tools:
%appdata%\npm\node_modules\PowerBI-visuals-tools\certs
Per l'istanza locale degli strumenti:For the local instance of the tools:
<Power BI visual project root>\node_modules\PowerBI-visuals-tools\certs
Formato PEMPEM format
Se si usa il formato di certificato Privacy Enhanced Mail (PEM), salvare il file del certificato con nome PowerBIVisualTest_public.crt e salvare la chiave privata con nome PowerBIVisualTest_private.key.If you use the Privacy Enhanced Mail (PEM) certificate format, save the certificate file as PowerBIVisualTest_public.crt, and save the private key as PowerBIVisualTest_private.key.
Formato PFXPFX format
Se si usa il formato di certificato Personal Information Exchange (PFX), salvare il file del certificato con nome PowerBIVisualTest_public.pfx.If you use the Personal Information Exchange (PFX) certificate format, save the certificate file as PowerBIVisualTest_public.pfx.
Se il file del certificato PFX richiede una passphrase:If your PFX certificate file requires a passphrase:
Nel file di configurazione specificare:In the config file, specify:
\PowerBI-visuals-tools\config.json
Nella sezione
server
specificare la passphrase sostituendo il segnaposto <YOUR PASSPHRASE>:In theserver
section, specify the passphrase by replacing the <YOUR PASSPHRASE> placeholder:"server":{ "root":"webRoot", "assetsRoute":"/assets", "privateKey":"certs/PowerBIVisualTest_private.key", "certificate":"certs/PowerBIVisualTest_public.crt", "pfx":"certs/PowerBIVisualTest_public.pfx", "port":"8080", "passphrase":"<YOUR PASSPHRASE>" }