Not able to connect to ejabberd server but admin gui is fine

Hi All,

I am very new to ejabberd but I am going through all documents to resolved issues. But from last two days I am struggling to connect ejabberd server I which installed on Ubuntu AWS EC2. I opened all ports for testing my. Withing Ubuntu I am able to chat using profanity.

Also I am able to connect to admin tool using https:// ( please note not http://)
https://ec2-XXXXXXXXXXX.us-west-2.compute.amazonaws.com:5280/admin

but I am not able to connect to server from android app using smack api as below(app is stopping after I enter details so not proper log message except 'Connecting to server'). Can you please give some pointer what I need to check next or any issue with config or smack api call issue? Please help you have any suggestion or links for further read. thanks a lot for you help in advance.

    public void connect() throws IOException,XMPPException,SmackException
    {
        Log.d(TAG, "Connecting to server " + mServiceName);
        XMPPTCPConnectionConfiguration.XMPPTCPConnectionConfigurationBuilder builder=
                XMPPTCPConnectionConfiguration.builder();
             builder.setUsernameAndPassword(mUsername, mPassword);
        builder.setRosterLoadedAtLogin(true);
        builder.setResource("Rooster");

        //Set up the ui thread broadcast message receiver.
        setupUiThreadBroadCastMessageReceiver();

        mConnection = new XMPPTCPConnection(builder.build());
        mConnection.addConnectionListener(this);
        mConnection.connect();
        mConnection.login();

ejabberd.yml config:

loglevel: 4
log_rotate_size: 0
log_rotate_date: ""
log_rate_limit: 100
hosts:
  - "ec2-XXXXXXXXXXX.us-west-2.compute.amazonaws.com"
listen:
  -
    port: 5222
    ip: "::"
    module: ejabberd_c2s
    certfile: "/etc/ejabberd/ejabberd.pem"
    starttls: true
    protocol_options:
      - "no_sslv3"
    max_stanza_size: 65536
    shaper: c2s_shaper
    access: c2s
    zlib: true
    resend_on_timeout: if_offline
  -
    port: 5269
    ip: "::"
    module: ejabberd_s2s_in
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    request_handlers:
      "/websocket": ejabberd_http_ws
    web_admin: true
    http_bind: true
    captcha: true
    tls: true
    certfile: "/etc/ejabberd/ejabberd.pem"
disable_sasl_mechanisms: "digest-md5"
s2s_use_starttls: optional
s2s_certfile: "/etc/ejabberd/ejabberd.pem"
s2s_protocol_options:
  - "no_sslv3"
auth_method: internal
auth_password_format: scram
shaper:
  normal: 1000
  fast: 50000
max_fsm_queue: 1000
acl:
  admin:
     user:
         - "admin": "ec2-XXXXXXXXXXX.us-west-2.compute.amazonaws.com"
  local:
    user_regexp: ""
  loopback:
    ip:
      - "127.0.0.0/8"
access:
  max_user_sessions:
    all: 10
  max_user_offline_messages:
    admin: 5000
    all: 100
  local:
    local: allow
  c2s:
    blocked: deny
    all: allow
  c2s_shaper:
    admin: none
    all: normal
  s2s_shaper:
    all: fast
  announce:
    admin: allow
  configure:
    admin: allow
  muc_admin:
    admin: allow
  muc_create:
    local: allow
  muc:
    all: allow
  pubsub_createnode:
    local: allow
  register:
    all: allow
  trusted_network:
    loopback: allow

language: "en"
modules:
  mod_adhoc: {}
  mod_admin_extra: {}
    access: announce
  mod_caps: {}
  mod_carboncopy: {}
  mod_client_state: {}
  mod_disco: {}
  mod_echo: {}
  mod_irc: {}
  mod_http_bind: {}
  mod_last: {}
  mod_muc:
    access: muc
    access_create: muc_create
    access_persistent: muc_create
    access_admin: muc_admin
  mod_muc_admin: {}
  mod_offline:
    access_max_user_messages: max_user_offline_messages
  mod_ping: {}
  mod_privacy: {}
  mod_private: {}
  mod_pubsub:
    access_createnode: pubsub_createnode
    ignore_pep_from_offline: true
    last_item_cache: false
    plugins:
      - "flat"
      - "hometree"
  mod_register:
    welcome_message:
      subject: "Welcome!"
      body: |-
        Hi.
        Welcome to this XMPP server.
    ip_access: trusted_network
    access: register
  mod_roster: {}
  mod_shared_roster: {}
  mod_stats: {}
  mod_time: {}
  mod_vcard:
    search: false
  mod_version: {}
allow_contrib_modules: true

I resolved this now. Somehow

I resolved this now. Somehow on EC2 security groups are being replaced with new rules after I save them. So I carefully modified security rules associated with required instance.

Syndicate content