Using NuGet artifact repositories

To configure NuGet in a restricted environment, modify the nuget.config file and use the SSL_CERT_FILE environment variable in the devfile to add self-signed certificates.

Configuring NuGet to use a non-standard artifact repository

NuGet searches for configuration files anywhere between the solution directory and the driver root directory. If you put the nuget.config file in the /projects directory, the nuget.config file defines NuGet behavior for all projects in /projects.

  • Create and place the nuget.config file in the /projects directory.

    Example nuget.config with a Nexus repository hosted at
    <?xml version="1.0" encoding="UTF-8"?>
        <add key="nexus2" value=""/>
            <add key="Username" value="user" />
            <add key="Password" value="..." />

Using self-signed certificates in NuGet projects

Internal artifact repositories often do not have a self-signed TLS certificate signed by an authority that is trusted by default. They are mainly signed by an internal company authority or are self-signed. Configure your tools to accept these certificates.

  1. Obtain the certificate used by the .NET server in the Privacy-Enhanced Mail (PEM) format. It is customary for administrators to provide certificates of internal artifact servers as Kubernetes secrets (see Importing untrusted TLS certificates to Che). The relevant server certificates will be mounted in /public-certs in every container in the workspace.

  2. Specify the location of the certificate file in the SSL_CERT_FILE environment variable in your devfile for the OmniSharp plug-in and for the .NET container.

    Example of the devfile:
      - id: redhat-developer/che-omnisharp-plugin/latest
        memoryLimit: 1024Mi
        type: chePlugin
        alias: omnisharp
         - value: /public-certs/nuget.cer
           name: SSL_CERT_FILE
     - mountSources: true
         - name: 5000/tcp
           port: 5000
       memoryLimit: 512Mi
       type: dockerimage
         - name: dotnet
           containerPath: /home/user
       alias: dotnet
       image: ''
         - value: /projects/tls/rootCA.crt
           name: SSL_CERT_FILE