-2

Hi i am new in Xamarin mobile aplication usnig Visual Studion 2019 version

when i run it shows below java error and i am unable to solve this can any one help me and guide how to fix this issue, need deep guideness.

Waiting you quick response thanks in advance..

Unhandled Exception: Javax.Net.Ssl.SSLHandshakeException:

here is my code

MainPage XAML Code:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:XamarinAPItutorial"
             x:Class="XamarinAPItutorial.MainPage">

    <StackLayout>
        <!-- Place new controls here -->
        <ListView 
            x:Name="ItemListView"
             HasUnevenRows="True">

            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout Padding="10">
                            <Label Text="{Binding user_name}"
                                   LineBreakMode="NoWrap" FontSize="8" />
                            <Label Text="{Binding user_pass}" LineBreakMode="NoWrap" FontSize="7"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
            
            
        </ListView>
    </StackLayout>

</ContentPage>

MainPage.cs code:

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using XamarinAPItutorial.Models;

namespace XamarinAPItutorial
{ 
    [DesignTimeVisible(true)]
    public partial class MainPage : ContentPage
    {
        private readonly HttpClient _client = new HttpClient();
        private const string Url = "https://xxxxx.com/ords/rstecs/SS/GET_USERS_ss";
        private ObservableCollection<fnd_user_v> fnduser;


        public MainPage()
        {
            InitializeComponent();
        }

        async override protected void OnAppearing()
        {
                string responsecontent = await _client.GetStringAsync(Url);
                List<fnd_user_v> mylist = JsonConvert.DeserializeObject<List<fnd_user_v>>(responsecontent);
                fnduser = new ObservableCollection<fnd_user_v>(mylist);
                ItemListView.ItemsSource = fnduser;
                base.OnAppearing();
        }




    }
}

user_v class:

using System;
using System.Collections.Generic;
using System.Text;

namespace XamarinAPItutorial.Models
{
   public class fnd_user_v
    {
        public int user_id { get; set; }
        public string user_name { get; set; }
        public string user_pass { get; set; }
        public string empname { get; set; }
        public string dept { get; set; }
    }
}

Error Iamge attached:

enter image description here

  • 1
    please search before posting - there are numerous existing questions about this error. https://www.google.com/search?q=xamarin+SSLHandshakeException+site:stackoverflow.com – Jason May 22 '22 at 15:05
  • already searched but no one article is related with my question. – Shoaib Shafiq May 22 '22 at 15:14
  • Have you looked at the exception details? You actually read through all of the many hits on the same error message and **none** of them are relevant to your case? Have you checked your server to verify that it doesn't have any issues with its SSL certificate? – Jason May 22 '22 at 15:47
  • Yes Json i have checked at server there is no SSL certificate issue. – Shoaib Shafiq May 22 '22 at 16:16
  • try the workaround here :https://stackoverflow.com/questions/54069581/how-to-resolve-javax-net-ssl-sslhandshakeexception-in-xamarin-forms – Adrain Zhu -MSFT May 26 '22 at 06:38

0 Answers0