Search in sources :

Example 1 with BasicClientConnectionManager

use of org.apache.http.impl.conn.BasicClientConnectionManager in project OpenAttestation by OpenAttestation.

the class SslUtil method getServerCertificates.

public static X509Certificate[] getServerCertificates(URL url) throws NoSuchAlgorithmException, KeyManagementException, IOException {
    if (!"https".equals(url.getProtocol())) {
        throw new IllegalArgumentException("URL scheme must be https");
    }
    int port = url.getPort();
    if (port == -1) {
        port = 443;
    }
    X509HostnameVerifier hostnameVerifier = new NopX509HostnameVerifierApache();
    CertificateStoringX509TrustManager trustManager = new CertificateStoringX509TrustManager();
    SSLContext sslcontext = SSLContext.getInstance("TLS");
    sslcontext.init(null, new X509TrustManager[] { trustManager }, null);
    SSLSocketFactory sf = new SSLSocketFactory(sslcontext, hostnameVerifier);
    Scheme https = new Scheme("https", port, sf);
    SchemeRegistry sr = new SchemeRegistry();
    sr.register(https);
    BasicClientConnectionManager connectionManager = new BasicClientConnectionManager(sr);
    HttpParams httpParams = new BasicHttpParams();
    httpParams.setParameter(ClientPNames.HANDLE_REDIRECTS, false);
    HttpClient httpClient = new DefaultHttpClient(connectionManager, httpParams);
    log.debug("Saving certificates from server URL: {}", url.toExternalForm());
    HttpHead request = new HttpHead(url.toExternalForm());
    HttpResponse response = httpClient.execute(request);
    log.debug("Server status line: {} {} ({})", new String[] { response.getProtocolVersion().getProtocol(), response.getStatusLine().getReasonPhrase(), String.valueOf(response.getStatusLine().getStatusCode()) });
    httpClient.getConnectionManager().shutdown();
    return trustManager.getStoredCertificates();
}
Also used : Scheme(org.apache.http.conn.scheme.Scheme) HttpResponse(org.apache.http.HttpResponse) SSLContext(javax.net.ssl.SSLContext) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) HttpHead(org.apache.http.client.methods.HttpHead) BasicHttpParams(org.apache.http.params.BasicHttpParams) HttpParams(org.apache.http.params.HttpParams) X509HostnameVerifier(org.apache.http.conn.ssl.X509HostnameVerifier) SchemeRegistry(org.apache.http.conn.scheme.SchemeRegistry) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) HttpClient(org.apache.http.client.HttpClient) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) SSLSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory) BasicHttpParams(org.apache.http.params.BasicHttpParams)

Example 2 with BasicClientConnectionManager

use of org.apache.http.impl.conn.BasicClientConnectionManager in project cloudstack by apache.

the class HypervDirectConnectResource method postHttpRequest.

public static String postHttpRequest(final String jsonCmd, final URI agentUri) {
    // Using Apache's HttpClient for HTTP POST
    // Java-only approach discussed at on StackOverflow concludes with
    // comment to use Apache HttpClient
    // http://stackoverflow.com/a/2793153/939250, but final comment is to
    // use Apache.
    String logMessage = StringEscapeUtils.unescapeJava(jsonCmd);
    logMessage = cleanPassword(logMessage);
    s_logger.debug("POST request to " + agentUri.toString() + " with contents " + logMessage);
    // Create request
    HttpClient httpClient = null;
    final TrustStrategy easyStrategy = new TrustStrategy() {

        @Override
        public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException {
            return true;
        }
    };
    try {
        final SSLSocketFactory sf = new SSLSocketFactory(easyStrategy, new AllowAllHostnameVerifier());
        final SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("https", DEFAULT_AGENT_PORT, sf));
        final ClientConnectionManager ccm = new BasicClientConnectionManager(registry);
        httpClient = new DefaultHttpClient(ccm);
    } catch (final KeyManagementException e) {
        s_logger.error("failed to initialize http client " + e.getMessage());
    } catch (final UnrecoverableKeyException e) {
        s_logger.error("failed to initialize http client " + e.getMessage());
    } catch (final NoSuchAlgorithmException e) {
        s_logger.error("failed to initialize http client " + e.getMessage());
    } catch (final KeyStoreException e) {
        s_logger.error("failed to initialize http client " + e.getMessage());
    }
    String result = null;
    // TODO: are there timeout settings and worker thread settings to tweak?
    try {
        final HttpPost request = new HttpPost(agentUri);
        // JSON encode command
        // Assumes command sits comfortably in a string, i.e. not used for
        // large data transfers
        final StringEntity cmdJson = new StringEntity(jsonCmd);
        request.addHeader("content-type", "application/json");
        request.setEntity(cmdJson);
        s_logger.debug("Sending cmd to " + agentUri.toString() + " cmd data:" + logMessage);
        final HttpResponse response = httpClient.execute(request);
        // Unsupported commands will not route.
        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
            final String errMsg = "Failed to send : HTTP error code : " + response.getStatusLine().getStatusCode();
            s_logger.error(errMsg);
            final String unsupportMsg = "Unsupported command " + agentUri.getPath() + ".  Are you sure you got the right type of" + " server?";
            final Answer ans = new UnsupportedAnswer(null, unsupportMsg);
            s_logger.error(ans);
            result = s_gson.toJson(new Answer[] { ans });
        } else if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
            final String errMsg = "Failed send to " + agentUri.toString() + " : HTTP error code : " + response.getStatusLine().getStatusCode();
            s_logger.error(errMsg);
            return null;
        } else {
            result = EntityUtils.toString(response.getEntity());
            final String logResult = cleanPassword(StringEscapeUtils.unescapeJava(result));
            s_logger.debug("POST response is " + logResult);
        }
    } catch (final ClientProtocolException protocolEx) {
        // Problem with HTTP message exchange
        s_logger.error(protocolEx);
    } catch (final IOException connEx) {
        // Problem with underlying communications
        s_logger.error(connEx);
    } finally {
        httpClient.getConnectionManager().shutdown();
    }
    return result;
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) TrustStrategy(org.apache.http.conn.ssl.TrustStrategy) Scheme(org.apache.http.conn.scheme.Scheme) AllowAllHostnameVerifier(org.apache.http.conn.ssl.AllowAllHostnameVerifier) HttpResponse(org.apache.http.HttpResponse) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) KeyStoreException(java.security.KeyStoreException) IOException(java.io.IOException) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) ClientConnectionManager(org.apache.http.conn.ClientConnectionManager) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) KeyManagementException(java.security.KeyManagementException) ClientProtocolException(org.apache.http.client.ClientProtocolException) StringEntity(org.apache.http.entity.StringEntity) UnsupportedAnswer(com.cloud.agent.api.UnsupportedAnswer) CheckSshAnswer(com.cloud.agent.api.check.CheckSshAnswer) GetDomRVersionAnswer(com.cloud.agent.api.GetDomRVersionAnswer) CheckS2SVpnConnectionsAnswer(com.cloud.agent.api.CheckS2SVpnConnectionsAnswer) SetPortForwardingRulesAnswer(com.cloud.agent.api.routing.SetPortForwardingRulesAnswer) SetSourceNatAnswer(com.cloud.agent.api.routing.SetSourceNatAnswer) PlugNicAnswer(com.cloud.agent.api.PlugNicAnswer) GetVmConfigAnswer(com.cloud.agent.api.GetVmConfigAnswer) NetworkUsageAnswer(com.cloud.agent.api.NetworkUsageAnswer) Answer(com.cloud.agent.api.Answer) UnPlugNicAnswer(com.cloud.agent.api.UnPlugNicAnswer) SetStaticNatRulesAnswer(com.cloud.agent.api.routing.SetStaticNatRulesAnswer) IpAssocAnswer(com.cloud.agent.api.routing.IpAssocAnswer) SetFirewallRulesAnswer(com.cloud.agent.api.routing.SetFirewallRulesAnswer) CheckRouterAnswer(com.cloud.agent.api.CheckRouterAnswer) SetStaticRouteAnswer(com.cloud.agent.api.routing.SetStaticRouteAnswer) UnsupportedAnswer(com.cloud.agent.api.UnsupportedAnswer) UnrecoverableKeyException(java.security.UnrecoverableKeyException) HttpClient(org.apache.http.client.HttpClient) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) SchemeRegistry(org.apache.http.conn.scheme.SchemeRegistry) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) SSLSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory)

Example 3 with BasicClientConnectionManager

use of org.apache.http.impl.conn.BasicClientConnectionManager in project cloudstack by apache.

the class NexentaNmsClient method getHttpsClient.

protected DefaultHttpClient getHttpsClient() {
    try {
        SSLContext sslContext = SSLUtils.getSSLContext();
        X509TrustManager tm = new X509TrustManager() {

            @Override
            public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
            }

            @Override
            public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException {
            }

            @Override
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }
        };
        sslContext.init(null, new TrustManager[] { tm }, new SecureRandom());
        SSLSocketFactory socketFactory = new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("https", nmsUrl.getPort(), socketFactory));
        BasicClientConnectionManager mgr = new BasicClientConnectionManager(registry);
        return new DefaultHttpClient(mgr);
    } catch (NoSuchAlgorithmException ex) {
        throw new CloudRuntimeException(ex.getMessage());
    } catch (KeyManagementException ex) {
        throw new CloudRuntimeException(ex.getMessage());
    }
}
Also used : Scheme(org.apache.http.conn.scheme.Scheme) SecureRandom(java.security.SecureRandom) SSLContext(javax.net.ssl.SSLContext) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) X509Certificate(java.security.cert.X509Certificate) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) KeyManagementException(java.security.KeyManagementException) X509TrustManager(javax.net.ssl.X509TrustManager) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) SchemeRegistry(org.apache.http.conn.scheme.SchemeRegistry) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) SSLSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory)

Example 4 with BasicClientConnectionManager

use of org.apache.http.impl.conn.BasicClientConnectionManager in project cdap by caskdata.

the class ExternalLDAPAuthenticationServerSSLTest method getHTTPClient.

@Override
protected HttpClient getHTTPClient() throws Exception {
    SSLContext sslContext = SSLContext.getInstance("SSL");
    // set up a TrustManager that trusts everything
    sslContext.init(null, new TrustManager[] { new X509TrustManager() {

        @Override
        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
            return null;
        }

        @Override
        public void checkClientTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws CertificateException {
        //
        }

        @Override
        public void checkServerTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws CertificateException {
        //
        }
    } }, new SecureRandom());
    SSLSocketFactory sf = new SSLSocketFactory(sslContext);
    Scheme httpsScheme = new Scheme("https", getAuthServerPort(), sf);
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    // apache HttpClient version >4.2 should use BasicClientConnectionManager
    ClientConnectionManager cm = new BasicClientConnectionManager(schemeRegistry);
    return new DefaultHttpClient(cm);
}
Also used : Scheme(org.apache.http.conn.scheme.Scheme) SecureRandom(java.security.SecureRandom) CertificateException(java.security.cert.CertificateException) SSLContext(javax.net.ssl.SSLContext) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) ClientConnectionManager(org.apache.http.conn.ClientConnectionManager) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) X509TrustManager(javax.net.ssl.X509TrustManager) SchemeRegistry(org.apache.http.conn.scheme.SchemeRegistry) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) SSLSocketFactory(org.apache.http.conn.ssl.SSLSocketFactory)

Example 5 with BasicClientConnectionManager

use of org.apache.http.impl.conn.BasicClientConnectionManager in project jersey by jersey.

the class HelloWorldTest method testConnectionClosingOnExceptionsForErrorResponses.

/**
     * JERSEY-2157 reproducer.
     * <p>
     * The test ensures that entities of the error responses which cause
     * WebApplicationException being thrown by a JAX-RS client are buffered
     * and that the underlying input connections are automatically released
     * in such case.
     */
@Test
public void testConnectionClosingOnExceptionsForErrorResponses() {
    final BasicClientConnectionManager cm = new BasicClientConnectionManager();
    final AtomicInteger connectionCounter = new AtomicInteger(0);
    final ClientConfig config = new ClientConfig().property(ApacheClientProperties.CONNECTION_MANAGER, new ClientConnectionManager() {

        @Override
        public SchemeRegistry getSchemeRegistry() {
            return cm.getSchemeRegistry();
        }

        @Override
        public ClientConnectionRequest requestConnection(final HttpRoute route, final Object state) {
            connectionCounter.incrementAndGet();
            final ClientConnectionRequest wrappedRequest = cm.requestConnection(route, state);
            /**
                         * To explain the following long piece of code:
                         *
                         * All the code does is to just create a wrapper implementations
                         * for the AHC connection management interfaces.
                         *
                         * The only really important piece of code is the
                         * {@link org.apache.http.conn.ManagedClientConnection#releaseConnection()} implementation,
                         * where the connectionCounter is decremented when a managed connection instance
                         * is released by AHC runtime. In our test, this is expected to happen
                         * as soon as the exception is created for an error response
                         * (as the error response entity gets buffered in
                         * {@link org.glassfish.jersey.client.JerseyInvocation#convertToException(javax.ws.rs.core.Response)}).
                         */
            return new ClientConnectionRequest() {

                @Override
                public ManagedClientConnection getConnection(long timeout, TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException {
                    final ManagedClientConnection wrappedConnection = wrappedRequest.getConnection(timeout, tunit);
                    return new ManagedClientConnection() {

                        @Override
                        public boolean isSecure() {
                            return wrappedConnection.isSecure();
                        }

                        @Override
                        public HttpRoute getRoute() {
                            return wrappedConnection.getRoute();
                        }

                        @Override
                        public SSLSession getSSLSession() {
                            return wrappedConnection.getSSLSession();
                        }

                        @Override
                        public void open(HttpRoute route, HttpContext context, HttpParams params) throws IOException {
                            wrappedConnection.open(route, context, params);
                        }

                        @Override
                        public void tunnelTarget(boolean secure, HttpParams params) throws IOException {
                            wrappedConnection.tunnelTarget(secure, params);
                        }

                        @Override
                        public void tunnelProxy(HttpHost next, boolean secure, HttpParams params) throws IOException {
                            wrappedConnection.tunnelProxy(next, secure, params);
                        }

                        @Override
                        public void layerProtocol(HttpContext context, HttpParams params) throws IOException {
                            wrappedConnection.layerProtocol(context, params);
                        }

                        @Override
                        public void markReusable() {
                            wrappedConnection.markReusable();
                        }

                        @Override
                        public void unmarkReusable() {
                            wrappedConnection.unmarkReusable();
                        }

                        @Override
                        public boolean isMarkedReusable() {
                            return wrappedConnection.isMarkedReusable();
                        }

                        @Override
                        public void setState(Object state) {
                            wrappedConnection.setState(state);
                        }

                        @Override
                        public Object getState() {
                            return wrappedConnection.getState();
                        }

                        @Override
                        public void setIdleDuration(long duration, TimeUnit unit) {
                            wrappedConnection.setIdleDuration(duration, unit);
                        }

                        @Override
                        public boolean isResponseAvailable(int timeout) throws IOException {
                            return wrappedConnection.isResponseAvailable(timeout);
                        }

                        @Override
                        public void sendRequestHeader(HttpRequest request) throws HttpException, IOException {
                            wrappedConnection.sendRequestHeader(request);
                        }

                        @Override
                        public void sendRequestEntity(HttpEntityEnclosingRequest request) throws HttpException, IOException {
                            wrappedConnection.sendRequestEntity(request);
                        }

                        @Override
                        public HttpResponse receiveResponseHeader() throws HttpException, IOException {
                            return wrappedConnection.receiveResponseHeader();
                        }

                        @Override
                        public void receiveResponseEntity(HttpResponse response) throws HttpException, IOException {
                            wrappedConnection.receiveResponseEntity(response);
                        }

                        @Override
                        public void flush() throws IOException {
                            wrappedConnection.flush();
                        }

                        @Override
                        public void close() throws IOException {
                            wrappedConnection.close();
                        }

                        @Override
                        public boolean isOpen() {
                            return wrappedConnection.isOpen();
                        }

                        @Override
                        public boolean isStale() {
                            return wrappedConnection.isStale();
                        }

                        @Override
                        public void setSocketTimeout(int timeout) {
                            wrappedConnection.setSocketTimeout(timeout);
                        }

                        @Override
                        public int getSocketTimeout() {
                            return wrappedConnection.getSocketTimeout();
                        }

                        @Override
                        public void shutdown() throws IOException {
                            wrappedConnection.shutdown();
                        }

                        @Override
                        public HttpConnectionMetrics getMetrics() {
                            return wrappedConnection.getMetrics();
                        }

                        @Override
                        public InetAddress getLocalAddress() {
                            return wrappedConnection.getLocalAddress();
                        }

                        @Override
                        public int getLocalPort() {
                            return wrappedConnection.getLocalPort();
                        }

                        @Override
                        public InetAddress getRemoteAddress() {
                            return wrappedConnection.getRemoteAddress();
                        }

                        @Override
                        public int getRemotePort() {
                            return wrappedConnection.getRemotePort();
                        }

                        @Override
                        public void releaseConnection() throws IOException {
                            connectionCounter.decrementAndGet();
                            wrappedConnection.releaseConnection();
                        }

                        @Override
                        public void abortConnection() throws IOException {
                            wrappedConnection.abortConnection();
                        }

                        @Override
                        public String getId() {
                            return wrappedConnection.getId();
                        }

                        @Override
                        public void bind(Socket socket) throws IOException {
                            wrappedConnection.bind(socket);
                        }

                        @Override
                        public Socket getSocket() {
                            return wrappedConnection.getSocket();
                        }
                    };
                }

                @Override
                public void abortRequest() {
                    wrappedRequest.abortRequest();
                }
            };
        }

        @Override
        public void releaseConnection(ManagedClientConnection conn, long keepalive, TimeUnit tunit) {
            cm.releaseConnection(conn, keepalive, tunit);
        }

        @Override
        public void closeExpiredConnections() {
            cm.closeExpiredConnections();
        }

        @Override
        public void closeIdleConnections(long idletime, TimeUnit tunit) {
            cm.closeIdleConnections(idletime, tunit);
        }

        @Override
        public void shutdown() {
            cm.shutdown();
        }
    });
    config.connectorProvider(new ApacheConnectorProvider());
    final Client client = ClientBuilder.newClient(config);
    final WebTarget rootTarget = client.target(getBaseUri()).path(ROOT_PATH);
    // Test that connection is getting closed properly for error responses.
    try {
        final String response = rootTarget.path("error").request().get(String.class);
        fail("Exception expected. Received: " + response);
    } catch (InternalServerErrorException isee) {
    // do nothing - connection should be closed properly by now
    }
    // Fail if the previous connection has not been closed automatically.
    assertEquals(0, connectionCounter.get());
    try {
        final String response = rootTarget.path("error2").request().get(String.class);
        fail("Exception expected. Received: " + response);
    } catch (InternalServerErrorException isee) {
        assertEquals("Received unexpected data.", "Error2.", isee.getResponse().readEntity(String.class));
        // Test buffering:
        // second read would fail if entity was not buffered
        assertEquals("Unexpected data in the entity buffer.", "Error2.", isee.getResponse().readEntity(String.class));
    }
    assertEquals(0, connectionCounter.get());
}
Also used : ClientConnectionRequest(org.apache.http.conn.ClientConnectionRequest) ConnectionPoolTimeoutException(org.apache.http.conn.ConnectionPoolTimeoutException) HttpConnectionMetrics(org.apache.http.HttpConnectionMetrics) HttpHost(org.apache.http.HttpHost) SchemeRegistry(org.apache.http.conn.scheme.SchemeRegistry) HttpEntityEnclosingRequest(org.apache.http.HttpEntityEnclosingRequest) TimeUnit(java.util.concurrent.TimeUnit) HttpException(org.apache.http.HttpException) ClientConfig(org.glassfish.jersey.client.ClientConfig) Client(javax.ws.rs.client.Client) HttpRequest(org.apache.http.HttpRequest) ManagedClientConnection(org.apache.http.conn.ManagedClientConnection) SSLSession(javax.net.ssl.SSLSession) HttpContext(org.apache.http.protocol.HttpContext) HttpResponse(org.apache.http.HttpResponse) IOException(java.io.IOException) PoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) ClientConnectionManager(org.apache.http.conn.ClientConnectionManager) HttpClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager) HttpRoute(org.apache.http.conn.routing.HttpRoute) HttpParams(org.apache.http.params.HttpParams) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BasicClientConnectionManager(org.apache.http.impl.conn.BasicClientConnectionManager) InternalServerErrorException(javax.ws.rs.InternalServerErrorException) WebTarget(javax.ws.rs.client.WebTarget) InetAddress(java.net.InetAddress) Socket(java.net.Socket) JerseyTest(org.glassfish.jersey.test.JerseyTest) Test(org.junit.Test)

Aggregations

SchemeRegistry (org.apache.http.conn.scheme.SchemeRegistry)7 BasicClientConnectionManager (org.apache.http.impl.conn.BasicClientConnectionManager)7 Scheme (org.apache.http.conn.scheme.Scheme)6 SSLSocketFactory (org.apache.http.conn.ssl.SSLSocketFactory)6 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)6 SSLContext (javax.net.ssl.SSLContext)5 ClientConnectionManager (org.apache.http.conn.ClientConnectionManager)5 SecureRandom (java.security.SecureRandom)4 X509TrustManager (javax.net.ssl.X509TrustManager)3 HttpResponse (org.apache.http.HttpResponse)3 IOException (java.io.IOException)2 KeyManagementException (java.security.KeyManagementException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 CertificateException (java.security.cert.CertificateException)2 X509Certificate (java.security.cert.X509Certificate)2 HttpClient (org.apache.http.client.HttpClient)2 Answer (com.cloud.agent.api.Answer)1 CheckRouterAnswer (com.cloud.agent.api.CheckRouterAnswer)1 CheckS2SVpnConnectionsAnswer (com.cloud.agent.api.CheckS2SVpnConnectionsAnswer)1 GetDomRVersionAnswer (com.cloud.agent.api.GetDomRVersionAnswer)1