<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting exception as 'peer not authenticated' while creating recurring billing in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58376#M33036</link>
    <description>&lt;P&gt;A self-signed certificate would be the way to go for localhost. By the way, an easy to use tool for this purpose would be: &lt;A href="https://zerossl.com/free-ssl/" target="_self"&gt;Zero SSL&lt;/A&gt;,&amp;nbsp;just enter your non-existent domain or IP into the top field.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2017 17:48:06 GMT</pubDate>
    <dc:creator>NexusSoftware</dc:creator>
    <dc:date>2017-06-06T17:48:06Z</dc:date>
    <item>
      <title>Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58355#M33029</link>
      <description>&lt;P&gt;I am getting exception while create a new recurring billing with below Java code. Same code was worked well one month ago&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static void subscriptionPayment(String apiLoginId, String transactionKey) 
{
	try{
			SimpleDateFormat sDF = new SimpleDateFormat("yyyy-MM-dd");
			Calendar d = Calendar.getInstance();			    
		    		
			SimpleDateFormat eDF = new SimpleDateFormat("MM/yyyy");
			Date expireDate = eDF.parse("12/2019");
			eDF.applyPattern("yyyy-MM");
			
			Merchant merchant ;
			
			merchant = Merchant.createMerchant(Environment.SANDBOX, apiLoginId, transactionKey);
			
			String planFOR = "";
			PaymentSchedule new_schedule = PaymentSchedule.createPaymentSchedule();			    
		    
			new_schedule.setIntervalLength(1);
	    	d.add(Calendar.MONTH, 1);
		    planFOR = "MONTHLY";
		    
		    new_schedule.setSubscriptionUnit(SubscriptionUnitType.MONTHS);
		    new_schedule.setStartDate(sDF.format(d.getTime()));
		    new_schedule.setTotalOccurrences(9999);
		    new_schedule.setTrialOccurrences(0);
		    			    
		    // Create a new credit card
		    CreditCard credit_card = CreditCard.createCreditCard();
		    credit_card.setCreditCardNumber("4111111111111111"); 
		    credit_card.setExpirationDate(eDF.format(expireDate));
		    credit_card.setCardCode("656");

		    // Create a billing info
		    Address billing_info = Address.createAddress();
		    
	    	billing_info.setLastName("Miller");
	    	billing_info.setFirstName("David");
		    
		    billing_info.setCompany("ABC");
		    billing_info.setAddress("Address");
		    billing_info.setCity("City");
		    billing_info.setCountry("Country");
		    billing_info.setFaxNumber("23654565");
		    billing_info.setPhoneNumber("0123456789");
		    billing_info.setState("State");
		    billing_info.setZipPostalCode("21254");
		    
		    // Create a customer and specify billing info
		    Customer customer = Customer.createCustomer();
		    customer.setBillTo(billing_info);
		    customer.setEmail("davidmiller@gmail.com");			    
		    
		    // Create a subscription and specify payment, schedule and customer
		    //
		    Subscription subscription = Subscription.createSubscription();
		    subscription.setPayment(Payment.createPayment(credit_card));
		    subscription.setSchedule(new_schedule);
		    subscription.setCustomer(customer);
	        subscription.setAmount(new BigDecimal(9));
		    subscription.setTrialAmount(Transaction.ZERO_AMOUNT);
		    subscription.setRefId("REF:" + System.currentTimeMillis());
		    subscription.setName("User Subscription");
		    Order order = Order.createOrder();
		    order.setDescription(subscription.getName());
		    subscription.setOrder(order);
		    
		    net.authorize.arb.Transaction transaction =
		        merchant.createARBTransaction(TransactionType.CREATE_SUBSCRIPTION,
		            subscription);
		    
		    Result&amp;lt;Transaction&amp;gt; result =(Result&amp;lt;Transaction&amp;gt;) merchant.postTransaction(transaction);
				    
		    for(int i = 0; i &amp;lt; result.getMessages().size(); i++){
		    	
		      Message message = (Message)result.getMessages().get(i);
		      if(message.getCode().equals("I00001")){
		      
		    }
	    }
	}
	catch(Exception ex){
	}
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Below error getting in console while executing above code. Help me to solve the issue.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;2017-06-02 18:07:45 HttpClient [INFO] Use Proxy: 'false'&lt;BR /&gt;2017-06-02 18:07:45 HttpCallTask [ERROR] Http request execute failed: 'peer not authenticated'&lt;BR /&gt;2017-06-02 18:07:45 HttpCallTask [WARN] Adding ErrorMessage: Code: 'javax.net.ssl.SSLPeerUnverifiedException', Text: 'peer not authenticated'&lt;BR /&gt;2017-06-02 18:07:45 ApiOperationBase [ERROR] Invalid response:'net.authorize.api.contract.v1.ANetApiResponse@a1e932e'&lt;BR /&gt;2017-06-02 18:07:46 HttpClient [WARN] Exception getting response: 'peer not authenticated': 'null', '[sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:421), org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128), org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:397), org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148), org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149), org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121), org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573), org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732), net.authorize.util.HttpClient.executeXML(HttpClient.java:245), net.authorize.Merchant.postTransaction(Merchant.java:290), PaymentTest.subscriptionPayment(PaymentTest.java:224), PaymentTest.main(PaymentTest.java:146)]'&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 14:50:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58355#M33029</guid>
      <dc:creator>davidarul</dc:creator>
      <dc:date>2017-06-05T14:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58357#M33030</link>
      <description>&lt;P&gt;You could&lt;/P&gt;&lt;PRE&gt;try {
SSLContext ctx = SSLContext.getInstance("TLSv1.2");
ctx.init(null, null, null);
SSLContext.setDefault(ctx);
} catch (Exception e) {
System.out.println(e.getMessage());
}&lt;/PRE&gt;&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;final SSLContext ctx = SSLContext.getInstance("TLSv1.2");
ctx.init(null,null, new java.security.SecureRandom());
final SSLSocketFactory socketFactory = ctx.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(socketFactory);&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Jun 2017 16:40:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58357#M33030</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-06-05T16:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58366#M33031</link>
      <description>&lt;P&gt;Added this code in my method still getting same issue&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 07:00:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58366#M33031</guid>
      <dc:creator>davidarul</dc:creator>
      <dc:date>2017-06-06T07:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58367#M33032</link>
      <description>&lt;P&gt;Ensure your server has a valid non-expired SSL Certificate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to diagnose, is to use Wireshark to capture the network traffic from your application. &amp;nbsp;Once the traffic is captured, click Analyze -&amp;gt; Decode As -&amp;gt; Transport, select the port and then select SSL, apply and save the settings. The captured traffic will be shown as SSL. Look for the response of the "client hello" message in the captured traffic, this is where the SSL/TLS handshake is done.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 07:32:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58367#M33032</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-06-06T07:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58371#M33033</link>
      <description>&lt;P&gt;How can I use dummy ssl for localhost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give me some suggession?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 14:52:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58371#M33033</guid>
      <dc:creator>davidarul</dc:creator>
      <dc:date>2017-06-06T14:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58376#M33036</link>
      <description>&lt;P&gt;A self-signed certificate would be the way to go for localhost. By the way, an easy to use tool for this purpose would be: &lt;A href="https://zerossl.com/free-ssl/" target="_self"&gt;Zero SSL&lt;/A&gt;,&amp;nbsp;just enter your non-existent domain or IP into the top field.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 17:48:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58376#M33036</guid>
      <dc:creator>NexusSoftware</dc:creator>
      <dc:date>2017-06-06T17:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58505#M33141</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I upgraded to TSL1.2 and still getting the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am&amp;nbsp;used&amp;nbsp;anet-java-sdk 1.9.3 and Java 1.7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting error in net.authorize.util.HttpClient file. Below line getting exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://image.prntscr.com/image/hBZYIAUaRlu4pZwXhMb7nA.png" border="0" alt="" width="642" height="607" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 12:47:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/58505#M33141</guid>
      <dc:creator>davidarul</dc:creator>
      <dc:date>2017-06-19T12:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting exception as 'peer not authenticated' while creating recurring billing</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/62446#M36766</link>
      <description>Hello, was there any resolution to this issue?</description>
      <pubDate>Mon, 02 Apr 2018 19:03:37 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Getting-exception-as-peer-not-authenticated-while-creating/m-p/62446#M36766</guid>
      <dc:creator>Jnovakcw</dc:creator>
      <dc:date>2018-04-02T19:03:37Z</dc:date>
    </item>
  </channel>
</rss>

