0

I want to add a new appointment in my Exchange server 2013 by using Java and Exchange Web Services Api 2.0.

But I always have this exception :

Exception in thread "main" microsoft.exchange.webservices.data.ServiceRequestException: The request failed. The request failed. hostname in certificate didn't match: <10.0.6.4> != ms-ex

Here is a part of My code :

ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("userName", "password");
service.setCredentials(credentials);

service.setUrl(new URI("https:// server address/ews/exchange.asmx"));

Appointment appointment = new Appointment(service);
appointment.setSubject("Appointment subject");
.
.
.
appointment.save();
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
The Guide
  • 37
  • 1
  • 2
  • 11

1 Answers1

0

This sounds like an SSL problem. You are accessing the server with a URL that doesn't match the hostnames configured in the SSL cert, so the API gives that error. It's the same as if you browse to that URL, you would get a warning asking if you wish to proceed due to the cert name mismatch. Try using the URL that matches the certificate.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34